Memory consumption problem in large file parsing.
Hello,

I am trying to parse Measurement Data Format file of size 4 TB and perform some operations on the parsed data, the application which is written based on the C++ parser generated from kaitai struct compiler in the target language Cpp-STL with C++ 11 compatibility works fine but with an exception that it consumes more memory as user defined types(classes in the generated library) in .ksy is created as parsing continues through out the file and only be destroyed at the end. 
The application works with good performance for files with size upto 4TB(as I have tested on few files), but as the parsing objects increases for the file, the memory is increasing linearly and already parsed objects saved in memory will not allow me parse more(when max memory available is reached) as all of them will be destroyed at the end.

Is there any way I can destroy the objects that have been parsed to manage memory consumption of my application before the parsing actually ends. Solution to this would help me to strengthen application to parse file of any size and as many components(user types defined in .ksy) available in the file.

Appreciate your help and suggestion.

Thank you.

Regards,
Chaithra
