Modify

Opened 15 years ago

Closed 15 years ago

#2849 closed defect (fixed)

[PATCH] Preferences dialog leaks memory

Reported by: jttt Owned by: team
Priority: minor Milestone:
Component: Core Version:
Keywords: Cc:

Description

First time PreferencesDialog is shown, 4MB of memory is not released. Every subsequent use of PreferencesDialog leaks another 750kB of memory.

This happens because settings modules are kept in static variable PreferencesDialog.settings - that acounts for the first 4MB. When PrefererencesDialog is shown then some preferences modules add listener to the dialog which prevents dialog from being released from memory and accounts for another 750kB.

The patch fixed that by using settings module factory instead of direct references to settings module.

Don't forget to add two new files to version control:
src/org/openstreetmap/josm/plugins/PluginPreferenceFactory.java
src/org/openstreetmap/josm/gui/preferences/PreferenceSettingFactory.java

Plugins are not affected except for little change is color-schema, which I can commit by myself.

Attachments (1)

preferencesmemoryleak.patch (55.5 KB ) - added by jttt 15 years ago.

Download all attachments as: .zip

Change History (2)

by jttt, 15 years ago

Attachment: preferencesmemoryleak.patch added

comment:1 by stoecker, 15 years ago

Resolution: fixed
Status: newclosed

In r1742.

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.