From: SourceForge.net <no...@so...> - 2012-05-21 19:06:55
|
Patches item #3528606, was opened at 2012-05-21 07:53 Message generated for change (Comment added) made by jarekczek You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300588&aid=3528606&group_id=588 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Thomas Meyer (thomasmey) Assigned to: Nobody/Anonymous (nobody) Summary: Correctly unref old objects in UndoManager.addEdit() Initial Comment: While implementing an limit for compundEdit objects I did copy the unref code from UndoManager.addEdit(). But I still got OOM error with the new code inplace. The solution was to fix the existing unref code. ---------------------------------------------------------------------- >Comment By: Jarek Czekalski (jarekczek) Date: 2012-05-21 12:06 Message: Thomas, I think you're wrong here. Please consider a simple example, a list consisting of elements: A, B, C A is referenced only by B and by HEAD. Original unref code removes both references to A. It becomes free and GC may finalize it. The change you did is that after consecutive removal of list elements, each element is dereferenced. Before your change, only one of the removed elements was dereferenced. But after finalizing that one, another one got dereferenced. And so on, chain reaction. However I see GC rarely finalizes Edit-s. For example: I do 1000 replaces, run GC (through clicking jedit memory indicator, I believe it does run GC). Then undo. I see no finalizes. Then I do a single edit and undo. GC. Only now it finalizes. It works the same with and without your patch. I attach a patch to track edits. So I would like to see additional justification for this change. Theoretically it does not do anything meaningful. Please correct me if I'm wrong. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=300588&aid=3528606&group_id=588 |