Modify

Opened 23 months ago

Closed 23 months ago

Last modified 23 months ago

#23422 closed defect (wontfix)

[Patch] ParallelWayAction should not store a reference to MapView

Reported by: GerdP Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

  1. Start JOSM
  2. open data layer (this creates an instance of MapView)
  3. close data layer
  4. create heapdump

What is the expected result?

MapView instance is garbage collected

What happens instead?

Field ParallelWayAction.mv still refers to the MapView instance and MapView may refer to all kinds
of objects because of listeners.

Please provide any additional information below. Attach a screenshot if possible.

Build-Date:2024-01-19 16:26:03
Revision:18947
Is-Local-Build:true

Identification: JOSM/1.5 (18947 SVN en) Windows 10 64-Bit
OS Build number: Windows 10 Home 2009 (19045)
Memory Usage: 431 MB / 1678 MB (335 MB allocated, but free)
Java version: 1.8.0_272-b10, AdoptOpenJDK, OpenJDK 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
System property file.encoding: UTF-8
System property sun.jnu.encoding: Cp1252
Locale info: en_DE
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:58709, -ea, -javaagent:D:\eclipse-java-2020-09\eclipse\configuration\org.eclipse.osgi\3245\0\.cp\lib\javaagent-shaded.jar, -Dfile.encoding=UTF-8, -Dstdout.encoding=UTF-8, -Dstderr.encoding=UTF-8]
Program arguments: [--language=en, --debug]

Plugins:
+ OpeningHoursEditor (36196)
+ RoadSigns (36196)
+ apache-commons (36176)
+ buildings_tools (36200)
+ comfort0 (36200)
+ o5m (36126)
+ pbf (36176)
+ poly (36126)
+ reltoolbox (36200)
+ reverter (36196)
+ undelete (36126)
+ utilsplugin2 (36200)

Validator rules:
+ c:\josm\core\resources\data\validator\combinations.mapcss
+ c:\josm\core\resources\data\validator\geometry.mapcss
+ c:\josm\core\resources\data\validator\relation.mapcss
+ c:\josm\core\resources\data\validator\unnecessary.mapcss
+ d:\java_tools\JOSM\mygeometry.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Rules/GermanySpecific&zip=1

Attachments (1)

23422.patch (5.4 KB ) - added by GerdP 23 months ago.

Download all attachments as: .zip

Change History (4)

by GerdP, 23 months ago

Attachment: 23422.patch added

comment:1 by GerdP, 23 months ago

This isn't an issue in real life as a new MapView instance is created soon, but it makes it difficult to find real memory leaks and there seems to be no good reason to store the reference despite fewer uses of MainApplication.getMap().mapView.

comment:2 by GerdP, 23 months ago

Resolution: wontfix
Status: assignedclosed

Hmm, looking again at all the actions which store a reference to MapView it would probably be easier to fix those places where listeners are not removed properly.

in reply to:  1 comment:3 by stoecker, 23 months ago

Replying to GerdP:

This isn't an issue in real life as a new MapView instance is created soon, but it makes it difficult to find real memory leaks and there seems to be no good reason to store the reference despite fewer uses of MainApplication.getMap().mapView.

Also keep in mind that one of JOSM goals is to become more modular. Referencing static variables isn't helping that goal.

E.G. I'd still like to have a mini-view of the main map view with a lower zoom level showing the current map position (would make orientation much easier). For that to work the mapView must be usable at least two times...

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.