Hi all,
I run into a memory issue when uses boost wave library. My application runs
as a *service *that parses c files. In each individual run, it calls in the
wave library through a sub-function call to process one file. I noticed that
some memory is not released from wave after each run. The consequence is
that the memory usage of the application keeps increasing till the system
breaks down.
I could reproduce the problem with a simple modification of the quick_start
sample code shipped with the boost wave library. (attached below).
My system is win64 and I see the problem with both 1.49 and 1.55. (built
with b2 toolset=msvc-11.0 address-model=64 --build-type=complete)
Something I found during the investigation:
* The problem is gone if I build the application with link<static>.
(Unfortunately, this is not an option for me)
* From the memory usage pattern, it seems that there is a memory pool in
place that should have been released after each turn.
When repeatedly passing a 4MB file, the memory usage (taken from task
maneger) is: 99,700K, 198,404K, 395,404K, 395408K, and 789,396K.
When running with static link, the memory usage after each run is: 1800K,
2480K, 2480K, .... The maximum usage is 8300K.
Is there any workaround with the problem?
Thanks,
Yong
------------------------------------- begin of the code
---------------------------------------------------
#define BOOST_WAVE_SERIALIZATION 0 // enable
serialization
#define BOOST_WAVE_BINARY_SERIALIZATION 0 // use binary archives
#define BOOST_WAVE_XML_SERIALIZATION 1 // use XML archives
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Include Wave itself
#include