|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.javatools.parser.util.ArrayListHeap
The ArrayListHeap
class is a utility class which keeps
a cache of empty ArrayList instances for quick reuse. During the
course of a regular parse of a 200k Java file for example, about
2700 ArrayList's are allocated, then discarded. Generally no more
than about 30-40 lists are allocated at any given time.
By pooling these together into a cache/heap, we can reduce the frequency of allocations and GC's necessary for these ArrayLists. If you use this class, you MUST follow the contract that all allocated lists from this pool must be freed back to this pool.
Constructor Summary | |
ArrayListHeap()
|
Method Summary | |
protected static java.util.ArrayList |
allocArrayList()
Utility routine to allocate an ArrayList instance from the heap. |
protected static void |
freeArrayList(java.util.ArrayList list)
Utility routine to free an ArrayList instance back to the heap to allow it to be reused. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ArrayListHeap()
Method Detail |
protected static java.util.ArrayList allocArrayList()
protected static void freeArrayList(java.util.ArrayList list)
list
- the list to free
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.