|[tracecompass-dev] Reusing TmfStateValue objects|
I am trying to reduce storage consumption by my plugin. This plugin creates a large number of TmfStateValue objects, where multiple TmfStateValue objects may have the same value.
If I just create the TmfStateValue objects without regard to duplication, my plugin works without problems.
I tried to reuse TmfStateValue objects by maintaining a HashMap<TmfStateValue, TmfStateValue> hash map where the TmfStateValue object is both the key and the value, essentially a HashSet, but where I can get a value of an object in the set, which HashSet doesn't allow.
If I do this, I intermittently get an IndexOutOfBounds exception at line 601 of CallstackView.java (Neon SR1 version). Sometimes, when I load a trace I get this exception. Other times the same trace loads with no problem.
Is there a reason why attempting to reuse TmfStateValue objects will not work or why I should not be doing this? I realize TmfStateValue maintains an internal cache of 128 elements, but this is too small, which is why I am trying this approach.
I'm doing something similar with TmfEventField objects and that seems to work fine.
Back to the top