POV-Ray : Newsgroups : povray.advanced-users : #undef and arrays Server Time
30 Jul 2024 16:19:27 EDT (-0400)
  #undef and arrays (Message 1 to 4 of 4)  
From: Rainer Mager
Subject: #undef and arrays
Date: 14 May 1999 00:50:59
Message: <373b9da3.0@news.povray.org>
Hi all,

    I've been trying to optimize my sponge fractal scene some more (see
p.b.i) and I think I've found a bug in POV. It seems that the #undef
function does not work on arrays. That is to day, it does take the array out
of the variable name-space (i.e., I can't use it anymore) but it doesn't
seem to free up the used memory.
    Why do I think this?
    Because my scene allocates a large array. It then does stuff and creates
a lot of objects. I think clear the array and create a lot more objects. The
memory usage for this scenario is exactly the same as if I do the same
without clearing (#undef) the array.
    I would think that when I #undef the array the objects created after it
would be able to use the freed up memory and reduce the peak memory usage.


    Thoughts? Ideas?


--Rainer


Post a reply to this message

From: Peter Houston
Subject: Re: #undef and arrays
Date: 14 May 1999 04:02:29
Message: <373bca85.0@news.povray.org>
Rainer Mager <-no-### [at] golcom> wrote in message
<373b9da3.0@news.povray.org>...
>    I would think that when I #undef the array the objects created after it
>would be able to use the freed up memory and reduce the peak memory usage.
>


I could be wrong, I usually am, but isn't peak memory usage just that, the
peak or highest the memory reaches for the scene, not the total memory usage
for the whole scene.  As I see it if you had a short scene with the array in
it, and then the same array in a scene ten times longer, as long a nothing
else in the scene uses more memory in one hit, the peak memory usage would
be the same.

I'm sure someone will correct me if my understanding of this is wrong.

Regards,

Peter H.


Post a reply to this message

From: Bob Hughes
Subject: Re: #undef and arrays
Date: 14 May 1999 08:57:07
Message: <373C0F45.168992C4@aol.com>
Far as I understand it peak memory goes to the highest amount used
overall. The #undef question is possibly another matter but I'm guessing
POV-Ray still counts peak memory as whatever it attains at the fullest
regardless of changing it out over the time of the parse.
Somebody elses turn now to debunk what I've said.


Peter Houston wrote:
> 
> Rainer Mager <-no-### [at] golcom> wrote in message
> <373b9da3.0@news.povray.org>...
> >    I would think that when I #undef the array the objects created after it
> >would be able to use the freed up memory and reduce the peak memory usage.
> >
> 
> I could be wrong, I usually am, but isn't peak memory usage just that, the
> peak or highest the memory reaches for the scene, not the total memory usage
> for the whole scene.  As I see it if you had a short scene with the array in
> it, and then the same array in a scene ten times longer, as long a nothing
> else in the scene uses more memory in one hit, the peak memory usage would
> be the same.
> 
> I'm sure someone will correct me if my understanding of this is wrong.
> 
> Regards,
> 
> Peter H.

-- 
 omniVERSE: beyond the universe
  http://members.aol.com/inversez/homepage.htm
 mailto://inversez@aol.com?Subject=PoV-News


Post a reply to this message

From: Nieminen Mika
Subject: Re: #undef and arrays
Date: 14 May 1999 09:28:55
Message: <373c1707.0@news.povray.org>
Peter Houston <hou### [at] inamecom> wrote:
: I could be wrong, I usually am, but isn't peak memory usage just that, the
: peak or highest the memory reaches for the scene, not the total memory usage
: for the whole scene.  As I see it if you had a short scene with the array in
: it, and then the same array in a scene ten times longer, as long a nothing
: else in the scene uses more memory in one hit, the peak memory usage would
: be the same.

  Perhaps you are confusing "peak memory used" and "largest alloc"?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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