Article View: borland.public.cppbuilder.nativeapi
Article #10548Re: VM Size is not reduced
From: Andrue Cope
Date: Fri, 02 Apr 2004 14:23
Date: Fri, 02 Apr 2004 14:23
30 lines
2436 bytes
2436 bytes
On Fri, 2 Apr 2004 20:28:13 +0700, Sara T. wrote: > I am worry because my application needs to be running 24*7 and it makes > another application on that machine cannot be run as well. If the cause is the natural fragmentation of the heap then you need to improve your heap usage. The likely reason for the HM doing what I suggested is performance. By keeping the free list short the HM would have a shorter list to sort through when a new allocation is requested. The only solution to this is to implement your own heap management. When we ran into this problem we were lucky. It was an isolatable subprocess and therefore amenable to a specific solution. A simple class was produced that effectively 'cached' allocations. This meant that when our routine released memory it wasn't given back to the HM and could be reused later. The class used a std::map where the key was the block size and this proved enough for us. No attempt was made to suballocate blocks which vastly simplified the class. If your problem is more endemic then you may need to replace the HM completely with one of your own. C++ is fully supportive of this but never having done it I don't know the details. I believe that it involves overloading the new and delete operators. NB:My comments about the cause and internal workings of the HM are speculation. Educated speculation perhaps but I may be completely wrong :) -- Andrue Cope [Bicester UK]
Technical Details
Message-ID:
<1659mthjuxcac.pjevm6eq7378.dlg@40tude.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<406a2eaa@newsgroups.borland.com> <wqvuvtc9ju5j.103w64ropni1s.dlg@40tude.net> <406d6a77@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,47b4c8bfa962b00d X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-04-02 06:40:15 PST From: Andrue Cope <no.spam@spammy.com> Subject: Re: VM Size is not reduced Newsgroups: borland.public.cppbuilder.nativeapi User-Agent: 40tude_Dialog/2.0.10.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit References: <406a2eaa@newsgroups.borland.com> <wqvuvtc9ju5j.103w64ropni1s.dlg@40tude.net> <406d6a77@newsgroups.borland.com> Date: Fri, 2 Apr 2004 15:23:01 +0100 Message-ID: <1659mthjuxcac.pjevm6eq7378.dlg@40tude.net> NNTP-Posting-Host: 217.207.223.34 X-Trace: newsgroups.borland.com 1080915828 217.207.223.34 (2 Apr 2004 06:23:48 -0800) Lines: 30 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail