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.
BasePosition is quite expensive and (automatic) folds are pretty common in XML documents, so any saving here would be nice. Sample 1.3MB xsd document has 10.000 folds -> 40.000 BasePositions+infrastructure. Cutting number of BPs in half (by tracking guarded areas differently) would save over 1MB of heap (1.5MB without fixing issue 100489)
Positions are not that expensive, but instead of guarded areas, the fold could listen on document events to decide whether it will be damaged or not by the upcoming change (remove).