You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The resident memory usage is ... random, so looking at the Heap Snapshot (which is something that makes sense):
Edit: turns out the resident memory usage measurements were all skewed by the web worker receiving these large files. The web worker no longer receives such large files.
model memory = c0 + file size + (x + 32) * lineCount , where 32 comes from our allocating a MinimalModelLine per line and x depends on the line length (i.e. the overhead of a string object around a character array). x is smaller for long lines, and larger for short lines; it is around 12 - 36 bytes.
OSX resident memory usage for the file: 163 MB -> 87 MB : 46.6% less
Heap total memory usage for the file: 88 MB -> 77 MB : 12.5% less
Heap overhead over file size: 15 MB -> 4 MB : 73.3% less
Totals - file B - 177 MB - 3,171,200 lines
OSX resident memory usage for the file: 1284 MB -> 340 MB : 73.5% less
Heap total memory usage for the file: 666 MB -> 375 MB : 43.7% less
Heap overhead over file size: 489 MB -> 198 MB : 59.5% less
Final test on win 32 bits
File
Private Bytes
Working Set
Heap (via Timeline)
empty.txt
107 MB
147 MB
33 MB
file A - 73 MB - 99,127 lines
165 MB
219 MB
105 MB
file B - 177 MB - 3,171,200 lines
361 MB
415 MB
336 MB
file 2*B - 351 MB - 6,342,399 lines
627 MB
679 MB
561 MB
file 4*B - 700 MB - 12MM lines
failed
failed
failed
Final test on win 64 bits
File
Private Bytes
Working Set
Heap (via Timeline)
empty.txt
128 MB
201 MB
56.5 MB
file A - 73 MB - 99,127 lines
225 MB
268 MB
125 MB
file 2*A - 139 MB - 198,253 lines
266 MB
287 MB
201 MB
file 4*A - 278 MB - 396,505 lines
418 MB
435 MB
352 MB
file 8*A - 557 MB - 793,009 lines
737 MB
749 MB
658 MB
file 16*A - 1,115 MB - 1,586,017 lines
1,365 MB
1,367 MB
1,264 MB
file 32*A - 2,230 MB - x lines
failed
failed
failed
file B - 177 MB - 3,171,200 lines
612 MB
688 MB
414 MB
file 2*B - 351 MB - 6,342,399 lines
856 MB
919 MB
776 MB
file 4*B - 700 MB - 12MM lines
failed
failed
failed
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:
we refuse to open files above 300 MB on win 32 bit
we open any file size everywhere else
Reacted by Faustino Aguilar, Horace He, Michel Kaporin, Oleg Lustenko, Yukai Huang, Abhinav Gauniyal, Alex Soliar and Marco Silva
Activity
alexdima commentedon Jul 6, 2017
Removing ModelLine._lineNumber
1. file A
99127 lines
2. file B
3171200 lines
Eliminate ModelLine._lineNumber usage in ModelLine.append (#30180)
Remove ModelLine._lineNumber (#30180)
alexdima commentedon Jul 6, 2017
Using
MinimalModelLine1. file A
99127 lines
2. file B
3171200 lines
Extract IModelLine (#30180)
Explicit getters and setters for IModelLine.isInvalid (#30180)
Extract AbstractModelLine (#30180)
Use IModelLine in split and append (#30180)
Clarify usage of TextModel.isTooLargeForHavingAMode() (#30180)
Restrict usages of new ModelLine (#30180)
Add and use MinimalModelLine (#30180)
alexdima commentedon Jul 6, 2017
Using
MinimalModelLinewith lazy markers1. file A
99127 lines
2. file B
3171200 lines
7 remaining items
alexdima commentedon Jul 6, 2017
Using a hack to avoid
(sliced string)1. file A
99127 lines
2. file B
3171200 lines
Avoid `(sliced string)` (#30180)
alexdima commentedon Jul 6, 2017
Conclusions
The resident memory usage is ... random, so looking at the Heap Snapshot (which is something that makes sense):
model memory = c0 + file size + (x + 32) * lineCount, where32comes from our allocating aMinimalModelLineper line andxdepends on the line length (i.e. the overhead of a string object around a character array).xis smaller for long lines, and larger for short lines; it is around 12 - 36 bytes.Totals - file A - 73 MB - 99,127 lines
OSX resident memory usage for the file: 163 MB -> 87 MB : 46.6% less
Heap total memory usage for the file: 88 MB -> 77 MB : 12.5% less
Heap overhead over file size: 15 MB -> 4 MB : 73.3% less
Totals - file B - 177 MB - 3,171,200 lines
OSX resident memory usage for the file: 1284 MB -> 340 MB : 73.5% less
Heap total memory usage for the file: 666 MB -> 375 MB : 43.7% less
Heap overhead over file size: 489 MB -> 198 MB : 59.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:
Avoid `(sliced string)` slightly faster (#30180)
Also enter the large file case based on line count, not just on file …
Do not compute a hash if it is not used (#30180)
The indentation guesser only looks at the first 10k lines (#30180)
Hint lines array size for faster model creation (#30180)
Do not sync large models to web workers (#30180)
Tweak file limits based on experiments (#30180)
Chillee commentedon Jul 10, 2017
This seems like a pretty big improvement! I'm surprised to not see it on the iteration plan.
egamma commentedon Jul 10, 2017
Horace He (@Chillee) it is on the July iteration plan: #30209