Modify

Opened 12 years ago

Closed 12 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 12 years ago.

Download all attachments as: .zip

Change History (2)

Changed 12 years ago by jttt

Attachment: preferencesmemoryleak.patch added

comment:1 Changed 12 years ago by stoecker

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.