Opened 4 years ago
Closed 4 years ago
#2312 closed enhancement (fixed)
[PATCH] Lower memory usage using string interning
| Reported by: | jttt | Owned by: | team |
|---|---|---|---|
| Priority: | major | 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)
Changed 4 years ago by jttt
comment:1 Changed 4 years ago by stoecker
comment:2 Changed 4 years ago by jttt
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 Changed 4 years ago by jttt
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
comment:4 Changed 4 years ago by stoecker
- Resolution set to fixed
- Status changed from new to closed
In r1494.



Could you please explain why it does what it does?