Memory fragmentation @ boost::asio ?

Posted by Poni on Stack Overflow See other posts from Stack Overflow or by Poni
Published on 2010-05-31T11:11:51Z Indexed on 2010/05/31 11:12 UTC
Read the original article Hit count: 166

Filed under:
|
|

I'm pretty much stuck with a question I never got an answer for, a question which addresses an extremely important issue; memory fragmentation at boost::asio.

Found nothing at the documentation nor here at SO.

The functions at boost::asio, for example async_write() & async_read_some() always allocate something. (in my case it's 144 & 96 bytes respectively, in VC9 Debug build).

How do I know about it?
I connect a client to the "echo server" example provided with this library.
I put a breakpoint at "new.cpp" at the code of "operator new(size_t size)".
Then I send "123". Breakpoint is hit!
Now using the stack trace I can clearly see that the root to the "new" call is coming from the async_write() & async_read_some() calls I make in the function handlers.

So memory fragmentation will come sooner or later, thus I can't use ASIO, and I wish I could!

Any idea? Any helpful code example?

© Stack Overflow or respective owner

Related posts about memory

Related posts about fragmentation