[ace-users] Ace and Memory [NC]

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Mon Sep 10 13:27:52 CDT 2007


Hi Folks,

> Please check the allocator documentation, the first argument of the
> constructor is the number of chunks, the second the size of the chunk. At
> the moment the allocated has allocated the number if chunks the memory is
> used and you can't allocate anymore chunks.

BTW, if someone (e.g., Graham) wants to generalize
ACE_Dynamic_Cached_Allocator so that it can be dynamically expanded that
would be great.

thanks,

        Doug

> Regards,
> 
> Johnny Willemsen
> Remedy IT
> Postbus 101
> 2650 AC  Berkel en Rodenrijs
> The Netherlands
> www.theaceorb.nl / www.remedy.nl  
> 
> *** Integrated compile and test statistics see
> http://scoreboard.theaceorb.nl ***
> *** Commercial service and support for ACE/TAO/CIAO             ***
> *** See http://www.theaceorb.nl/en/support.html                 ***
> 
> > ACE version 5.6,
> > 
> > OS Windows XP Professional.
> > 
> > Compiler:   Borland C++ Builder version 6
> > 
> > 
> > Hi,
> > 
> > I'm using the ACE allocators in the hope of improving 
> > performance. The goal
> > is to reduce the time we spend doing heap allocations. We 
> > have no issues
> > with the size of our process or how much memory it consumes (broadly
> > speaking) but we definitely need to enhance performance via 
> > allocators.
> > We've already deploy boost allocators/memory pooling in other 
> > parts of the
> > application (the visual studio side), but we cannot use boost for our
> > borland c++ builder dlls/side (the app contains both dlls 
> > side by side) as
> > boost doesn't support c++ builder 6
> > 
> > 
> > In any case, I'm trying to use the ACE allocators to do some memory
> > pooling.
> > 
> > To this effect I started researching and testing the
> > ACE_Dynamic_Cached_Allocator which works fine.. except for one aspect.
> > 
> > The allocator uses;
> > 
> > ACE_Locked_Free_List<ACE_Cached_Mem_Pool_Node<char>, 
> > ACE_LOCK> free_list_;
> > 
> > 
> > 
> > when I create an instance of the allocator defined thus;
> > 
> > typedef ACE_Dynamic_Cached_Allocator<ACE_SYNCH_MUTEX> Allocator;
> > 
> > 
> > static Allocator allocator_(sizeof(Toto2), 100 );  // toto is my class
> > which needs to be sped up
> > 
> > it seems that after 100 chunks have been allocated, it does 
> > not allocate
> > any more. I need more memory to be allocated so subsequent 
> > calls to malloc
> > from my version of new will be satisfied after 100 chunks are 
> > returned.
> > 
> > 
> > void* Toto2::operator new (size_t size)
> > {
> >       return allocator_.malloc(size);
> > };
> > 
> > Looking at my test program, i can verify that after 100 
> > allocations (calls
> > to _malloc on the allocator), no more memory is allocated/added to the
> > pool.
> > 
> > Could anybody help me out? I have this stuff working with 
> > boost but as I
> > say, I can't use boost for my borland c++ builder 6 dll (they 
> > don't support
> > cbuilder 6)
> > 
> > 
> > 
> > thanks much and have a nice day
> > 
> > G
> > **************************************************************
> > ***********
> > This message and any attachments (the "message") are 
> > confidential and intended solely for the addressee(s).
> > Any unauthorised use or dissemination is prohibited. E-mails 
> > are susceptible to alteration.   
> > Neither SOCIETE GENERALE nor any of its subsidiaries or 
> > affiliates shall be liable for the message if altered, changed or
> > falsified.
> >                               ************
> > Ce message et toutes les pieces jointes (ci-apres le 
> > "message") sont confidentiels et etablis a l'intention 
> > exclusive de ses
> > destinataires. Toute utilisation ou diffusion non autorisee 
> > est interdite. Tout message electronique est susceptible 
> > d'alteration. 
> > La SOCIETE GENERALE et ses filiales declinent toute 
> > responsabilite au titre de ce message s'il a ete altere, 
> > deforme ou falsifie.
> > **************************************************************
> > ***********
> > 
> > _______________________________________________
> > ace-users mailing list
> > ace-users at mail.cse.wustl.edu
> > http://mail.cse.wustl.edu/mailman/listinfo/ace-users
> > 
> 
> _______________________________________________
> ace-users mailing list
> ace-users at mail.cse.wustl.edu
> http://mail.cse.wustl.edu/mailman/listinfo/ace-users



More information about the Ace-users mailing list