Opened 16 years ago
Closed 16 years ago
#2312 closed enhancement (fixed)
[PATCH] Lower memory usage using string interning
Reported by: | jttt | Owned by: | team |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Core | Version: | |
Keywords: | Cc: |
Description
JOSM memory usage can be easily reduced by interning node/way/relation keys. See attached patch.
Attachments (1)
Change History (5)
by , 16 years ago
Attachment: | string_intern.patch added |
---|
comment:1 by , 16 years ago
comment:2 by , 16 years ago
When you load osm file then some keys are used many times, like source, name, highway etc. Currently every time source key is found then new string is created for it. When patch is applied then all source keys will point to the same object.
comment:3 by , 16 years ago
String overhead is quite noticable, for example simple "source" will occupy 56 bytes of memory in Java. See
http://lists.openstreetmap.org/pipermail/josm-dev/2009-March/002730.html for benchmark
Could you please explain why it does what it does?