Repository navigation
Conversation
|
Just wanted to bump this. It fixes a renderer OOM crash on large external-level projects (#1172). Tested against the crasher project from that issue: renderer memory stays under 1GB now, where it previously blew past the ~4GB V8 heap cap and crashed before load even finished. Happy to address any review feedback. |
|
Hi! Thanks for that amazing PR, it will definitely help on large projects. Two issues I may have spotted though:
|
|
Thanks for the review, both were real issues.
Tested both in the app: a multi-line text field survives a single-file save and a reload, editing or deleting a .ldtkl outside LDtk gets detected and rewritten on save, and a save with no edits still doesn't touch any level file. The crasher project from #1172 still sits around 530MB of JS heap after loading and saving. |
|
I merged the change in |
|
Coming back after a few days of field testing:
The 1.5.4 branch is up to date with my latest fixes. Any idea for these? ☝️ |
|
Thanks a lot for taking the time to test it! Here's what I think is happening:
Would you like me to send a fix for these on top of |
|
The latest version on 1.5.4 now has timestamps in the log file, which should make tracking down the culprit a bit easier 🤔 |
Fixes #1172
Large projects with external levels were crashing the renderer because Electron's V8 heap is capped around 4GB (pointer compression), and every level was kept in memory 3 times: the live data, a parsed LevelJson object, and the pretty-printed JSON string. With the crasher project from the issue this goes over the cap before loading even finishes.
Changes:
.ldtklfile on disk, and reads it back only when actually needed..ldtklfiles are cleaned up after the save succeeds.Single-file projects keep the old in-memory cache, nothing changes for them.
Tested with the crasher project from the issue (55 levels, ~276MB): loads and saves fine now, renderer stays under 1GB where it used to hit 4GB and die. Also checked: saving without edits touches only the main
.ldtkfile, editing one level rewrites only that level's file, level rename/delete, save as to another folder, 0.9.3 project migration, and close/reopen round-trips (multi-world sample included).