Unlike version 2.0rc11, in version 2.1.3 the class MemoryObject hasn't equals() method. In this way getOrAddSafe() add always the object even if the object is already in the map, se we have memory leak. In my opinion you need to reintroduce the following method: public boolean equals(Object obj) { if(this == obj) { return true; } if(obj instanceof MemoryObject) { MemoryObject m = (MemoryObject) obj; return addr == m.addr && size == m.size ; } return false; }
Thank you for finding this regression! +++ Bug 938 - MemoryObject.java has no more equals() method Re-adding 'equals(..)' method erroneously removed with commit 8457bf35fee253d9af29ff1150a9671f6896fc17. 'equals(..)' is important to allow the HashMap<> for glMapBuffer(..) work properly! +++ Further GLBufferStateTracker / glMapBuffer work is underway, please see Bug 942 and review/help.