design for a parser to handle very large files
- by user619818
I have written a program which records protocol messages between an application and a hardware device which matches each application request with each hardware response. This is so that I can later remove the hardware, connect a 'replay' application to the main application and wait for an application request and reply with a matched copy of the requisite hardware reply message.
My replay application saves the matched request/response in a list (using C++ std::list).
This works fine on a small interaction session. My problem now is that I need to be able to use the replay over a long long session. With my current implementation, the replay program eventually uses up all available memory on my computer and crashes.
So I need some sort of lookahead - and not parse the whole session in one go.
Can anyone make any suggestions on how to get started?