Boost logo

Boost :

Subject: [boost] regex iterator memory leak
From: Marjan Yahyanejad (myahyanejad_at_[hidden])
Date: 2014-07-17 13:32:51


I am using the example code of regex iterator in
http://www.boost.org/doc/libs/1_55_0/libs/regex/doc/html/boost_regex/ref/regex_iterator.html
, in a linux machine with default boost config which means NON RECURSIVE,
and 4096 block size , I run the example with mtrace , setting it at
first line of main method and doing muntrace right before return 0, I see
that 4096 bytes get lost based on mtrace logs.

if there are no flaws in my test, then is there something I should
separately call to free up that memory? Otherwise that blocks seems lost to
me.

The original reason I started this test was that I have a similar code, and
I see memory corruption on my machine which is causing connection drops to
my rabbitmq server and it goes away as soon as I comment out the following
three lines. So I think there is something wrong with the memory
allocations of boost regex iterator.

boost::sregex_iterator m1(text.begin(), text.end(), expression);

 boost::sregex_iterator m2;
      std::for_each(m1, m2, &regex_callback);

Thanks

--

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk