POV-Ray : Newsgroups : povray.off-topic : Question about garbage collection (not a flame) : Re: Question about garbage collection (not a flame) Server Time
1 Oct 2024 15:22:41 EDT (-0400)
  Re: Question about garbage collection (not a flame)  
From: Darren New
Date: 31 Mar 2008 22:08:55
Message: <47f1a747$1@news.povray.org>
Warp wrote:
> Darren New <dne### [at] sanrrcom> wrote:
>> http://www.iecc.com/gclist/GC-faq.html
> 
>   "Most allocated objects have short lifetimes."
> 
>   Hmm, that may be so with languages which force you to allocate everything
> on the heap (ie. things which potentially have longer lifetimes than
> stack-allocated local objects).

And if it's not on the heap, but on the stack instead, it *still* has a 
pretty short lifetime. :-)

>   Personally I seldom find myself allocating memory dynamically for short
> periods of time in time-critical parts of the program, when coding in C++.
> Most short-lived objects and variables can usually be handled on the stack.

Yep. And a lot of languages are smart enough to figure that out 
automatically. Not Java as initially implemented.

One of the advantages of letting the compiler handle stuff like this for 
you is that the compiler can get smarter.

>   That's a bit surprising of a result, but might be explainable by
> cache behavior or something similar.

Yeah, or better addressing modes maybe?

-- 
   Darren New / San Diego, CA, USA (PST)
     "That's pretty. Where's that?"
          "It's the Age of Channelwood."
     "We should go there on vacation some time."


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.