#20630 closed defect (othersoftware)
Memory retained after deleting imagery layer
| Reported by: | Famlam | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Core imagery | Version: | |
| Keywords: | template_report memory imagery | Cc: | wiktorn |
Description
What steps will reproduce the problem?
- Open JOSM on any area with some imagery available (memory usage via task manager ~500MB)
- Load as many imagery layers as are available (memory usage ~1200MB)
- Delete all layers from step 2 (memory usage ~1200MB)
What is the expected result?
Memory back to 500MB
What happens instead?
Memory remains at 1200MB
Please provide any additional information below. Attach a screenshot if possible.
URL:https://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2021-03-17 18:58:40 +0100 (Wed, 17 Mar 2021) Build-Date:2021-03-17 17:59:56 Revision:17580 Relative:URL: ^/trunk Identification: JOSM/1.5 (17580 nl) Windows 10 64-Bit OS Build number: Windows 10 Home 2009 (19042) Memory Usage: 973 MB / 1820 MB (314 MB allocated, but free) Java version: 1.8.0_281-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel Screen: \Display0 1920×1080 (scaling 1,00×1,00) Maximum Screen Size: 1920×1080 Best cursor sizes: 16×16→32×32, 32×32→32×32 Dataset consistency test: No problems found Plugins: + OpeningHoursEditor (35640) + SimplifyArea (35640) + imagery_offset_db (35640) + pt_assistant (2.1.10-80-g7d9bba3) + reverter (35688) + tageditor (35640) + turnlanes-tagging (288) + undelete (35640) + utilsplugin2 (35691) Map paint styles: - https://josm.openstreetmap.de/josmfile?page=Styles/Lane_and_Road_Attributes&zip=1 - https://josm.openstreetmap.de/josmfile?page=Styles/PublicTransport&zip=1 + %UserProfile%\Documents\tijdelijke bestanden\josm-eigen.mappaint.mapcss - https://josm.openstreetmap.de/josmfile?page=Styles/Sidewalks&zip=1 Validator rules: + %UserProfile%\Documents\tijdelijke bestanden\josm-eigen.validator.mapcss Last errors/warnings: - 00009,029 E: org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSException: java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 74 - 00009,029 E: Skipping to the next rule, because of an error: - 00009,029 E: org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSException: Error at line 1473, column 102: java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 74 - 00045,364 W: Kan geen ondersteunde projectie vinden voor laag PDOK Luchtfoto actueel IR. Gebruik EPSG:3857. - 00045,364 W: Kan geen ondersteunde projectie vinden voor laag PDOK Luchtfoto actueel IR. Gebruik EPSG:3857.
Attachments (0)
Change History (3)
comment:1 by , 5 years ago
| Cc: | added |
|---|
comment:2 by , 5 years ago
| Resolution: | → othersoftware |
|---|---|
| Status: | new → closed |
It's not how the Java memory management works. Look for example here:
https://stackoverflow.com/questions/30458195/does-gc-release-back-memory-to-os
What might interest you though, that in situations of memory pressure, JVM may give back some of the memory it has allocated earlier. In the post linked above, you might find tips how to fine-tune Java runtime to be more eager to give back the memory. But this is not JOSM specific.
comment:3 by , 5 years ago
I've checked this with VisualVM. It shows that JOSM keeps a lot of downloaded bitmaps in memory. I see no good reason to do that but I also found no leak, the amount stays inside the configured limits.



Unless you tell the JRE that it should free unused memory this will not happen, no matter if the memory is used in JOSM or not.
BUT in fact JOSM keeps the memory in the cache. I am not sure if this is intended.