[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] [C++]heap allokering?



Anders Hellerup Madsen <sslug@sslug> writes:

> Er det sådan at du ved noget, sådan helt generelt, om det er bedst at
> få samlet blokke af fri hukommelse sammen så snart de bliver ledige,
> eller overlade det til en garbage collector funktion der kører når der
> er nødvendigt?

Som koder foretrækker jeg at ikke skulle bekymre mig om småting som
hukommelsesstyring. Det vil sige garbage collection eller en anden
smart måde at håndterer hukommelse på.

Tracing Garbage Collection har desvære normalt den ulempe at den
performancemæssigt ikke er særlig forudsigelig. Pludselig træder den i
kraft og så stopper programmet indtil garbage collectoren er
færdig. Ved interaktive ting er det kedeligt og ved hård
realtidsprogrammering er det uacceptabelt.

Reference Counting er noget bedre, men har nogle problemer med
cykliske datastrukture. (Så dem sørger man for ikke at lave)

Så er der en række smarte metoder der kræver en større analyse af
koden.


Men hvis man har skrappe krav til hukommelsesforbruget, real time-krav
eller man implementer runtime-understøttelse for noget af ovenstående
så giver det mening at holde tungen lige i munden og gøre det hele i
hånden. 

-- 
 Peter Makholm     |        We constantly have to keep in mind why natural
 sslug@sslug |    languages are good at what they're good at. And to
 http://hacking.dk |     never forget that Perl is a human language first,
                   |                        and a computer language second


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:44 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *