Reusing a parser instance (DeterministicParser or BacktrackingParser) results in a memory leak caused by the method lpg.runtime.Stacks.reallocateStacks(). This method is called before parsing a new file and it will copy the current stacks into new arrays of length "stack_length = old_stack_length + STACK_INCREMENT;". Because of this the stacks will continue to grow when reusing a parser.
A potential fix for this bug is adding the following lines to the reset method in the DeterministicParser/BacktrackingParser:
locationStack = null;
parseStack= null;
stateStack= null;