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.
CND text index is buffered in internal array that is written with delay on disk. Writing task is rescheduled. In fact the array can be huge while parsing. For example memory snapshot of 50% parsing Mozilla browser has 28M in StoreQueueEntry. Probably periodical writing of the array can reduce memory footprint. The second waste of memory is: APTIndexingWalker produces IDs as CharSequence. But APTIndexingWalker converts CharSequence ID to String. Storing IDs as CharSequence can reduce size of the intermediate array at least in 2-3 times. Convert CharSequence to string just before writing in CndTextIndexImpl.store().
Created attachment 130785 [details] YourKit report
Thanks Alexander!
Also heap has a lot of duplicated strings. For example macro name "NS_DECLARE_STATIC_IID_ACCESSOR" has 733 duplicates in the index queue.
store char sequences in intermediate array: http://hg.netbeans.org/cnd-main/rev/12a5c76ae223 Now 3394 instances of StoreQueueEntry consumes 10,085,072 bytes on 50% parsing Mozilla browser
thanks, Alexander. You fix is enough.
can not be easily verified
the fix is in releases branch: http://hg.netbeans.org/releases/rev/ae12f8d1513b