og.streamy.com/2009/07/24/determine-size-of-java-object-class/">"HOWTO: Determine the size of a Java Object or Class". So to optimize memory consumption, we use flat arrays, however this increases time of queries. During usual detection of duplicates most time consuming method is a {@link #getByResourceId(String)}: around 50% of time spent in this class and number of invocations of this method is 1% of total invocations, however total time spent in this class less than 1 second for small projects and around 2 seconds for projects like JDK.
Note that this implementation currently does not support deletion, however it's possible to implement.