Modify

Opened 18 years ago

Closed 17 years ago

#432 closed defect (fixed)

DownloadDialog leaks (8MB)

Reported by: petr.nejedly@… Owned by: framm
Priority: major Milestone:
Component: Core Version:
Keywords: Cc: petr.nejedly@…

Description

The OSM download dialog is never freed from memory, which reduces the heap available to the application by 8MB (because of the world map).

Attachments (2)

josm-image-leak.diff (522 bytes ) - added by anonymous 18 years ago.
Potential fix
josm-image-leak2.diff (3.7 KB ) - added by petr.nejedly@… 18 years ago.
Improved fix. Doesn't cause the NPE and prevents the leak through anither discovered path. Note it removes the ESC listener os the mouse selection, but it didn't worked anyway.

Download all attachments as: .zip

Change History (8)

by anonymous, 18 years ago

Attachment: josm-image-leak.diff added

Potential fix

comment:1 by Gabriel Ebner <ge@…>, 18 years ago

Resolution: fixed
Status: newclosed

Thank you. Applied as r411.

comment:2 by anonymous, 18 years ago

Cc: petr.nejedly@… added
Resolution: fixed
Status: closedreopened

I have to reopen this bug, as r412 caused a regression (the leak is back).

I'm sorry my patch caused bug #446 (fixed by above mentioned r412), I specifically tested whether the dialog gets recreated on subsequent accesses, but missed the GPX import (I usually work with my local traces).
The field needs to be cleared to free the memory and it is unfortunate that the GPX downloader access it this way.
I'll prepare better fix and post the diff later.

comment:3 by Gabriel Ebner <ge@…>, 18 years ago

Are you sure that there is a leak now? I did a few downloads and top didn't show any increase in memory use. (Or at least way less than 8M per download)

by petr.nejedly@…, 18 years ago

Attachment: josm-image-leak2.diff added

Improved fix. Doesn't cause the NPE and prevents the leak through anither discovered path. Note it removes the ESC listener os the mouse selection, but it didn't worked anyway.

comment:4 by anonymous, 18 years ago

I have updated the fix. The removal of the ESC listener might be questionable, but it didn't work (for me at least, ESC does nothing during mouse drag) and its original registration to the main window was wrong anyway:
It registered the SelectionManager used for selection on the download's WorldMap as a listener on the main mapping frame!

comment:5 by anonymous, 18 years ago

Yes, I'm sure there is a leak without my fix. Though the leak is one-time, as every new usage of the Download dialog frees the old instance (replaces the "dialog" field with new instance).

comment:6 by anonymous, 17 years ago

Resolution: fixed
Status: reopenedclosed

patch (semi)applied in r612. some things take longer than others... had overlooked this one

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain framm.
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.