Community
Participate
Working Groups
Build: 3.1 I can't believe I never thought of this... Many integer attributes of markers are the same. In particular, task priority is either 0, 1, or 2, and problem severity is either 0, 1, or 2. We could save 12-16 bytes per marker by keeping a singleton Integer pool for these common values!
Also consider sharing Boolean instances - I have seen many callers of IMarker.setAttributes[Object[] Object[]) where new Boolean objects are being passed to us. We should only ever store two instances of Boolean.
Fix released. On a large test case this saved about 1MB of memory (org.eclipse.ui.ide and all pre-reqs, with all compiler warnings turned on). In this case there are still several MB used by Integer objects associated with markers (char start, char end, line number, marker id). It feels like there is still room for further optimizations.