-
Notifications
You must be signed in to change notification settings - Fork 29.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve memory usage for large files #30180
Comments
Removing ModelLine._lineNumber
1. file A
2. file B
|
Using
|
empty file | 73 MB 99127 lines |
actual usage | overhead | overhead per line | |
---|---|---|---|---|---|
OSX RESIDENT | 190 MB | 347 MB | 157 MB | 84 MB | 888.6 B |
OSX Heap Snapshot | 50 MB | 133 MB | 83 MB | 10 MB | 105.8 B |
2. file B
empty file | 177 MB 3171200 lines |
actual usage | overhead | overhead per line | |
---|---|---|---|---|---|
OSX RESIDENT | 190 MB | 1078 MB | 888 MB | 711 MB | 235.1 B |
OSX Heap Snapshot | 50 MB | 577 MB | 527 MB | 350 MB | 115.7 B |
Using
|
empty file | 73 MB 99127 lines |
actual usage | overhead | overhead per line | |
---|---|---|---|---|---|
OSX RESIDENT | 190 MB | 348 MB | 158 MB | 85 MB | 899.1 B |
OSX Heap Snapshot | 50 MB | 132 MB | 82 MB | 9 MB | 95.2 B |
2. file B
empty file | 177 MB 3171200 lines |
actual usage | overhead | overhead per line | |
---|---|---|---|---|---|
OSX RESIDENT | 190 MB | 991 MB | 801 MB | 624 MB | 206.3 B |
OSX Heap Snapshot | 50 MB | 553 MB | 503 MB | 326 MB | 107.8 B |
Fixing the array leak of #30189
1. file A
2. file B
|
Using
|
empty file | 73 MB 99127 lines |
actual usage | overhead | overhead per line | |
---|---|---|---|---|---|
OSX RESIDENT | 190 MB | 344 MB | 154 MB | 81 MB | 856.8 B |
OSX Heap Snapshot | 50 MB | 129 MB | 79 MB | 6 MB | 63.5 B |
2. file B
empty file | 177 MB 3171200 lines |
actual usage | overhead | overhead per line | |
---|---|---|---|---|---|
OSX RESIDENT | 190 MB | 901 MB | 711 MB | 534 MB | 176.5 B |
OSX Heap Snapshot | 50 MB | 461 MB | 411 MB | 234 MB | 77.4 B |
Using a hack to avoid
|
empty file | 73 MB 99127 lines |
actual usage | overhead | overhead per line | |
---|---|---|---|---|---|
OSX RESIDENT | 190 MB | 341 MB | 151 MB | 78 MB | 825.1 B |
OSX Heap Snapshot | 50 MB | 127 MB | 77 MB | 4 MB | 42.31 B |
2. file B
empty file | 177 MB 3171200 lines |
actual usage | overhead | overhead per line | |
---|---|---|---|---|---|
OSX RESIDENT | 190 MB | 928 MB | 738 MB | 561 MB | 185.5 B |
OSX Heap Snapshot | 50 MB | 425 MB | 375 MB | 198 MB | 65.5 B |
ConclusionsThe resident memory usage is ... random, so looking at the Heap Snapshot (which is something that makes sense):
Totals - file A - 73 MB - 99,127 linesOSX resident memory usage for the file: 163 MB -> 87 MB : 46.6% less Totals - file B - 177 MB - 3,171,200 linesOSX resident memory usage for the file: 1284 MB -> 340 MB : 73.5% less Final test on win 32 bits
Final test on win 64 bits
It's hard to say what our limits should be based on the above results, since failure is not correlated with file size, nor with line count, but a function of the two. I suggest:
|
This seems like a pretty big improvement! I'm surprised to not see it on the iteration plan. |
e.g.
1. file A
Download Loan Data for 2016 Q3 from https://www.lendingclub.com/info/download-data.action
99127 lines
2. file B
Download
checker.ts
from https://github.com/Microsoft/TypeScript/blob/296660a2a077c32a2ed41cb762ef530031e56417/src/compiler/checker.tsGenerate a 128x times checker:
3171200 lines
The text was updated successfully, but these errors were encountered: