This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 38218 - GC documents from memory when not needed
Summary: GC documents from memory when not needed
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Text (show other bugs)
Version: 3.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: PERFORMANCE
Depends on:
Blocks: 38476
  Show dependency tree
 
Reported: 2003-12-18 17:25 UTC by Jaroslav Tulach
Modified: 2008-12-22 14:08 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Sample test and initial implementation (17.65 KB, patch)
2003-12-18 17:25 UTC, Jaroslav Tulach
Details | Diff
Another test: document should not disappear when it is modified (1.93 KB, patch)
2003-12-19 09:10 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2003-12-18 17:25:04 UTC
It would be nice to keep just a weak reference to
CloneableEditorSupport document and allow it to be
freed from memory when nobody needs it (not
modified, no references to it).

This would simplify the situation when somebody
get the document and now he does not know whether
to close it or leave open. With proper GC he could
just  leave it alone and it would be freed
automatically.
Comment 1 Jaroslav Tulach 2003-12-18 17:25:50 UTC
Created attachment 12634 [details]
Sample test and initial implementation
Comment 2 Jaroslav Tulach 2003-12-19 09:10:59 UTC
Created attachment 12639 [details]
Another test: document should not disappear when it is modified
Comment 3 _ pkuzel 2004-01-27 17:52:29 UTC
Can you evaluate, please? Estimated schedule?
Comment 4 Petr Nejedly 2004-01-28 14:06:54 UTC
Not as simple as it seems.
Please take into account locking issues and intarnal state machines
that needs to be consistent with real document availability.
Comment 5 Jaroslav Tulach 2007-10-18 08:35:54 UTC
Is not post beta2 the right time to work on this fix?
Comment 6 Jaroslav Tulach 2007-10-18 10:33:50 UTC
weak_dokument_38218 branch created in openide/text and it contains basic implementation.
Comment 7 Jan Becicka 2007-10-18 10:49:44 UTC
We'd like to see this issue fixed in 6.0. Refactoring must handle possibly hundreds of documents, which might stay open
in memory.
Comment 8 Jaroslav Tulach 2007-10-18 12:33:30 UTC
At your wish, Jan!

#38218: CloneableEditorSupport holds its document via weak references, so it can disappear from memory when no longer 
needed

DE:-------------------------------------------------
IDE: [18.10.07 13:32] Committing started
Checking in test/unit/src/org/openide/text/Deadlock56413Test.java;
/shared/data/ccvs/repository/openide/text/test/unit/src/org/openide/text/Deadlock56413Test.java,v  <--  
Deadlock56413Test.java
new revision: 1.5; previous revision: 1.4
done
Checking in test/unit/src/org/openide/text/CloneableEditorSupportTest.java;
/shared/data/ccvs/repository/openide/text/test/unit/src/org/openide/text/CloneableEditorSupportTest.java,v  <--  
CloneableEditorSupportTest.java
new revision: 1.9; previous revision: 1.8
done
Checking in src/org/openide/text/LineListener.java;
/shared/data/ccvs/repository/openide/text/src/org/openide/text/LineListener.java,v  <--  LineListener.java
new revision: 1.4; previous revision: 1.3
done
Checking in src/org/openide/text/CloneableEditorSupport.java;
/shared/data/ccvs/repository/openide/text/src/org/openide/text/CloneableEditorSupport.java,v  <--  
CloneableEditorSupport.java
new revision: 1.41; previous revision: 1.40
done
Checking in src/org/openide/text/PositionRef.java;
/shared/data/ccvs/repository/openide/text/src/org/openide/text/PositionRef.java,v  <--  PositionRef.java
new revision: 1.6; previous revision: 1.5
done
Checking in src/org/openide/text/NbDocument.java;
/shared/data/ccvs/repository/openide/text/src/org/openide/text/NbDocument.java,v  <--  NbDocument.java
new revision: 1.7; previous revision: 1.6
done
Checking in src/org/openide/text/DocumentLine.java;
/shared/data/ccvs/repository/openide/text/src/org/openide/text/DocumentLine.java,v  <--  DocumentLine.java
new revision: 1.8; previous revision: 1.7
done
IDE: [18.10.07 13:32] Committing finished