Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.6.0)

E13403-07

oracle.javatools.parser.util
Class ArrayListHeap

java.lang.Object
  extended by oracle.javatools.parser.util.ArrayListHeap
Direct Known Subclasses:
Conversions, ExpressionStack, PlsqlSymbol

public class ArrayListHeap
extends java.lang.Object

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

ArrayListHeap

public ArrayListHeap()
Method Detail

allocArrayList

protected static java.util.ArrayList allocArrayList()
Utility routine to allocate an ArrayList instance from the heap. This will reuse ArrayLists if possible.

Returns:
an empty ArrayList

freeArrayList

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.

Parameters:
list - the list to free

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.6.0)

E13403-07

Copyright © 1997, 2011, Oracle. All rights reserved.