POV-Ray : Newsgroups : povray.advanced-users : the POV-ray SDL--similar to Java and/or Python? : Re: the POV-ray SDL--similar to Java and/or Python? Server Time
6 Oct 2024 20:21:46 EDT (-0400)
  Re: the POV-ray SDL--similar to Java and/or Python?  
From: Darren New
Date: 14 Sep 2006 14:27:54
Message: <45099f2a$1@news.povray.org>
Warp wrote:
>   That would mean that the memory allocation engine knows ahead of time
> the order in which objects will be "forgotten" (ie. nothing points to them
> anymore so they can be freed) so that it can group them in contiguous
> memory. Of course this is impossible 

Um, yes. So, the reasonable conclusion would be "my initial premise is 
incorrect."

>   The only other alternative is that it performs memory defragmentation
> before freeing the objects. 

No. It usually performs memory defragmentation as a concurrent part of 
freeing the objects.

> But that doesn't sound any faster than
> freeing the objects directly. 

It depends on the ratio of freed objects to retained objects. If you 
retain only 2% of the objects you created since the last GC, it's a net win.

>   Oh, of course there's a third possibility: It doesn't free objects if
> freeing them would cause fragmentation. But then they would consume
> memory even though they are not used. Doesn't sound reasonable if that
> memory would be needed for something else.
That is generally only done in systems that use pointers rather than 
references. (I.e., systems where the address of the object can't change 
due to the semantics of the language, like C, rather than something like 
Java where there's no way to get to the underlying address given the 
refernece.)  Optimistic garbage collection (GIYF) often works that way.



-- 
   Darren New / San Diego, CA, USA (PST)
     Just because you find out you are
     telepathic, don't let it go to your head.


Post a reply to this message

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