Repository navigation
Conversation
Member
|
Thanks @nagisml — nice fix. Streaming the export chunk by chunk, and writing to a Since GSAK byte-for-byte compatibility matters a lot for GGZ/GPX, I checked it explicitly. I generated GPX, LOC and GGZ with the old and new code from the same test data (æøå,
The export, GPS dialog, POI and DB tests (380) all pass. Minor:
Approving. |
…SAK-Org#1075 Exporting 100,000+ caches ran out of memory: every cache was reloaded with its logs, waypoints and descriptions at once, and the whole GPX/LOC/GGZ document was then built in memory before being written. - Add iter_caches_full(), which reloads caches a chunk at a time; reload_caches_full() is now a list() over it. - Replace generate_gpx/loc/ggz with streaming write_gpx/loc/ggz that write each cache as it is reloaded. GGZ spools the GPX and the index into temporary files before building the zip. - File export writes to "<name>.part" next to the target and renames it over the target only once complete, so a failed export keeps the existing file instead of leaving a truncated one. - Device export (GPS dialog) and POI export use the streaming path too. KML export still loads all caches at once; left for a follow-up.
nagisml
force-pushed
the
fix/1075-export-memory
branch
from
October 18, 2026 12:27
7f94b7e to
f0c0042
Compare
Contributor
Author
|
@AgreeDK PR & commits fixed |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1075
Exporting a large database (100,000+ caches) to GPX, LOC or GGZ ran out of memory. Every cache was reloaded with its logs, waypoints and descriptions at once, and then the whole document was built in memory before it was written.
What changes
iter_caches_full()reloads caches one chunk at a time.reload_caches_full()is now justlist(iter_caches_full(...)).write_gpx/write_loc/write_ggzreplacegenerate_*and write each cache as it is reloaded. GGZ spools the GPX and the index into temporary files and then builds the zip.<name>.partand renames it over the target only when it has finished. If the export fails, the existing file is kept and no truncated file is left behind.Known limitations / follow-ups