-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Crash on openning a json file ~7Mb size #42260
Comments
@raphaelquati Can you please provide the file that causes the crash on open. Otherwise, a very similar one (or even a generated one) so we can reproduce the crash? |
The file contains sensitive data. I need to obfuscate the file. |
@raphaelquati Here is a nodejs script I put together which you might use: const fs = require('fs');
let contents = fs.readFileSync('input.json').toString();
contents = contents.replace(/[a-z]/g, 'a');
contents = contents.replace(/[A-Z]/g, 'A');
contents = contents.replace(/[0-9]/g, '1');
contents = contents.replace(/[^aA1":,.\[\]{}\s\n]/g, 'x');
fs.writeFileSync('output.json', contents); e.g. {"type":"FeatureCollection","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}}, "features": [
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[8.5068,47.2858],[8.5039,47.2731],[8.5021,47.2613],[8.5007,47.2613],[8.4724,47.2634],[8.4773,47.2889],[8.5068,47.2858]]]},"properties":{"gmdnr":1,"name":"Aeugst am Albis","kanton":"ZH","max_18":15.41}},
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[8.4445,47.2662],[8.4352,47.2476],[8.414,47.2437],[8.4101,47.2484],[8.4014,47.2682],[8.4261,47.2791],[8.4445,47.2662]]]},"properties":{"gmdnr":10,"name":"Obfelden","kanton":"ZH","max_18":15.41}},
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[8.5002,47.5429],[8.4904,47.528],[8.4615,47.5151],[8.4406,47.5381],[8.4561,47.5582],[8.5002,47.5429]]]},"properties":{"gmdnr":100,"name":"Stadel","kanton":"ZH","max_18":15.41}},
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[8.0675,47.0323],[8.06,46.9957],[8.035,46.9994],[8.0395,47.0211],[8.058,47.0288],[8.0675,47.0323]]]},"properties":{"gmdnr":1001,"name":"Doppleschwand","kanton":"LU","max_18":22.97}},
{"type":"Feature","geometry":{"type":"MultiPolygon","coordinates":[[[[8.0228,46.9765],[8.0097,46.9804],[8.0169,46.9831],[8.0228,46.9765]]],[[[8.1292,47.0127],[8.1442,47.0021],[8.1462,46.9706],[8.1623,46.9635],[8.1569,46.9334],[8.1222,46.9092],[8.0858,46.9061],[8.081,46.9149],[8.12,46.9284],[8.1354,46.9435],[8.1192,46.9608],[8.0686,46.9727],[8.06,46.9957],[8.0675,47.0323],[8.0683,47.0335],[8.0905,47.0352],[8.1292,47.0127]]]]},"properties":{"gmdnr":1002,"name":"Entlebuch","kanton":"LU","max_18":0}},
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[8.0621,46.9096],[8.0698,46.8957],[8.0705,46.8776],[8.0657,46.8596],[8.0422,46.8365],[8.0644,46.8077],[8.0469,46.7871],[8.0314,46.7903],[7.9846,46.775],[7.954,46.7917],[7.9535,46.7942],[7.9508,46.7997],[7.9479,46.814],[7.973,46.8477],[7.9574,46.885],[7.9923,46.9146],[8.0151,46.9179],[8.0621,46.9096]]]},"properties":{"gmdnr":1004,"name":"Flühli","kanton":"LU","max_18":22.97}},
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[8.06,46.9957],[8.0686,46.9727],[8.1192,46.9608],[8.1354,46.9435],[8.12,46.9284],[8.081,46.9149],[8.0858,46.9061],[8.0698,46.8957],[8.0621,46.9096],[8.0649,46.9346],[8.0454,46.9355],[8.0476,46.963],[8.0228,46.9765],[8.0169,46.9831],[8.035,46.9994],[8.06,46.9957]]]},"properties":{"gmdnr":1005,"name":"Hasle (LU)","kanton":"LU","max_18":22.97}},
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[8.058,47.0288],[8.0395,47.0211],[8.035,46.9994],[8.0169,46.9831],[8.0097,46.9804],[7.9745,46.9698],[7.9596,46.9736],[7.9524,46.9813],[7.9501,47.007],[7.9694,47.0296],[8.0157,47.0255],[8.0337,47.036],[8.058,47.0288]]]},"properties":{"gmdnr":1007,"name":"Romoos","kanton":"LU","max_18":22.97}},
{"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[8.0228,46.9765],[8.0476,46.963],[8.0454,46.9355],[8.0649,46.9346],[8.0621,46.9096],[8.0151,46.9179],[7.998,46.9179],[7.9859,46.9403],[7.9564,46.9515],[7.9596,46.9736],[7.9745,46.9698],[8.0097,46.9804],[8.0228,46.9765]]]},"properties":{"gmdnr":1008,"name":"Schüpfheim","kanton":"LU","max_18":22.97}}, output: {"aaaa":"AaaaaaaAaaaaaaaaa","aaa":{"aaaa":"aaaa","aaaaaaaaaa":{"aaaa":"aaa:aaa:aaa:aaa:AAA:1.1:AAA11"}}, "aaaaaaaa": [
{"aaaa":"Aaaaaaa","aaaaaaaa":{"aaaa":"Aaaaaaa","aaaaaaaaaaa":[[[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111]]]},"aaaaaaaaaa":{"aaaaa":1,"aaaa":"Aaaaaa aa Aaaaa","aaaaaa":"AA","aaax11":11.11}},
{"aaaa":"Aaaaaaa","aaaaaaaa":{"aaaa":"Aaaaaaa","aaaaaaaaaaa":[[[1.1111,11.1111],[1.1111,11.1111],[1.111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111]]]},"aaaaaaaaaa":{"aaaaa":11,"aaaa":"Aaaaaaaa","aaaaaa":"AA","aaax11":11.11}},
{"aaaa":"Aaaaaaa","aaaaaaaa":{"aaaa":"Aaaaaaa","aaaaaaaaaaa":[[[1.1111,11.1111],[1.1111,11.111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111]]]},"aaaaaaaaaa":{"aaaaa":111,"aaaa":"Aaaaaa","aaaaaa":"AA","aaax11":11.11}},
{"aaaa":"Aaaaaaa","aaaaaaaa":{"aaaa":"Aaaaaaa","aaaaaaaaaaa":[[[1.1111,11.1111],[1.11,11.1111],[1.111,11.1111],[1.1111,11.1111],[1.111,11.1111],[1.1111,11.1111]]]},"aaaaaaaaaa":{"aaaaa":1111,"aaaa":"Aaaaaaaaaaaaa","aaaaaa":"AA","aaax11":11.11}},
{"aaaa":"Aaaaaaa","aaaaaaaa":{"aaaa":"AaaaaAaaaaaa","aaaaaaaaaaa":[[[[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111]]],[[[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.111,11.1111],[1.11,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.11,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111]]]]},"aaaaaaaaaa":{"aaaaa":1111,"aaaa":"Aaaaaaaaa","aaaaaa":"AA","aaax11":1}},
{"aaaa":"Aaaaaaa","aaaaaaaa":{"aaaa":"Aaaaaaa","aaaaaaaaaaa":[[[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.111],[1.111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.111],[1.111,11.1111],[1.1111,11.111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111]]]},"aaaaaaaaaa":{"aaaaa":1111,"aaaa":"Aaxaaa","aaaaaa":"AA","aaax11":11.11}},
{"aaaa":"Aaaaaaa","aaaaaaaa":{"aaaa":"Aaaaaaa","aaaaaaaaaaa":[[[1.11,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.11,11.1111],[1.111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.111],[1.1111,11.1111],[1.1111,11.1111],[1.111,11.1111],[1.11,11.1111]]]},"aaaaaaaaaa":{"aaaaa":1111,"aaaa":"Aaaaa xAAx","aaaaaa":"AA","aaax11":11.11}},
{"aaaa":"Aaaaaaa","aaaaaaaa":{"aaaa":"Aaaaaaa","aaaaaaaaaaa":[[[1.111,11.1111],[1.1111,11.1111],[1.111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.111],[1.111,11.1111]]]},"aaaaaaaaaa":{"aaaaa":1111,"aaaa":"Aaaaaa","aaaaaa":"AA","aaax11":11.11}},
{"aaaa":"Aaaaaaa","aaaaaaaa":{"aaaa":"Aaaaaaa","aaaaaaaaaaa":[[[1.1111,11.1111],[1.1111,11.111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111],[1.1111,11.1111]]]},"aaaaaaaaaa":{"aaaaa":1111,"aaaa":"Aaaxaaaaaa","aaaaaa":"AA","aaax11":11.11}}, |
The file |
Thank you @raphaelquati I can reproduce the crash, even when renaming the file to @rebornix I believe this to be a regression from the new text buffer implementation. Every 3rd, 4th run I am able to open the file without crashing and I was able to record a profile run: Here is opening the file in stable: And here is opening the file on master (running from sources): @rebornix From a quick look, it appears A quick heap snapshot shows 70MB heap usage in stable and 2051MB heap usage on master! It appears that each rendered view ends up pointing to a copy of the single 11MB line, so the taller the viewport, the more memory usage... I also believe this is made worse by having the minimap turned on... @rebornix LMK if I can help mitigate this... |
Thanks @alexandrudima good catch here ;) After the change to
The renderer process memory usage increases by about 70 MB (a cold start uses 197 MB usually). It can be higher sometimes if the GC is not kicked in but it should be sane. |
Nice! Good work @rebornix Also thanks @raphaelquati for the file ! |
Extensions (18)
Steps to Reproduce:
Reproduces without extensions: Yes
The text was updated successfully, but these errors were encountered: