Most of std classes support custom allocators. basic_stringstream and vector do this as well. You can preallocate the memory needed and create objects in this memory locations. For more help see the placement new operator. But your question here is very general. It is for example possible use some COW implementation of your objects together with reference counted content. You objects are not duplicated on every copy, but only when one tries to write to the content. To give you better advices you should provide more specific examples. With Kind Regards, Ovanes On Fri, July 27, 2007 22:17, Richard wrote:
Well - I have zero experience here.
I remember that they were frequently advertised in the back of computer mags a few years back. Try Google? I saw...
http://www.freedownloadscenter.com/Programming/C_and_C++_Tools_and_Component s/SwiftAlloc_Memory_manager_replacement.html
and
Another possibility might be to look at how your app uses memory.
If you have vast numbers of objects all the same size you might benefit from a home written replacement for operator new. If you special case them all into a special pool it might get them out of the way of everything else. The general purpose manager that ships with the compiler is just that - general! Sounds like you have a specific problem.
HTH,
- Richard
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Bill Lear Sent: 27 July 2007 21:01 To: boost-users@lists.boost.org Subject: Re: [Boost-users] Stupid ostringstream question
On Friday, July 27, 2007 at 20:47:54 (+0100) Richard writes:
Have you tried investing in a replacement memory manager?
Such as?
It might give you a bigger overall payback than just tinkering with one aspect.
Certainly possible, however, it is also possible that the sheer size and number of objects we have in our application makes it inherently difficult for dynamically-allocated memory for small objects to work very well at very high memory usages. Thus the hope for a hybrid static store and ostringstream.
Bill _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
With Kind Regards, Ovanes Markarian