javaee / javahelp

javahelp
Other
14 stars 15 forks source link

Increadible memory leaks #20

Open glassfishrobot opened 16 years ago

glassfishrobot commented 16 years ago

If you show your help pages using

new CSH.DisplayHelpAfterTracking
(
helpBroker.getHelpSet(),
"javax.help.SecondaryWindow",
"Popup"
)

Whenever you close the help window the JHelp instance and all its components subtree stays in memory - do it few times and you get OutOfMemory exception.

1. BasicFavoritesNavigatorUI hooks itself as HelpSetListener to HelpSet and never releases the hook

2. JHelp is hookes to HelpSet as HelpSetListener and never releases the hook

3. The StyledDocument inside BasicContentViewerUI.JHEditorPane seems to be hanging on Styles from the defaultStyles inside HTMLEditorKit.

4. JHelpPrintHandler and its handlers is one big memory leak, somebody here does not understand how to use WeakHashMap - ONLY THE KEYS are hold via weak references not the values and if the value has a strong reference to the key then we have a memory leak

The same problem may happen with javax.help.MainWindow, the only savior there is the fact that the MainWindow is singleton and it is not recreated on every help display action.

Environment

Operating System: All Platform: All

Affected Versions

[current]

glassfishrobot commented 16 years ago

Reported by vtec

glassfishrobot commented 16 years ago

Was assigned to javahelp-issues

glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA JAVAHELP-20