POV-Ray : Newsgroups : povray.animations : System resources depleted in animations : System resources depleted in animations Server Time
5 Jul 2024 14:25:12 EDT (-0400)
  System resources depleted in animations  
From: Bosley
Date: 18 Mar 2003 19:55:03
Message: <web.3e77bf1a44ee95aa950c09400@news.povray.org>
I am having a problem with POV-Ray, and I wanted to talk it out here,
because I am not sure if it is a problem with POV-Ray, or with my coding.
I am doing a POV house (on and off for quite a while) and reciently got
back in the swing of things with POV 3.5.  I have not reciently measured
the size of the codebase I am working with, but rest assured it is at least
2k lines of well formated text.  The codebase is subdivided into multiple
include files (walls.inc, ceilings.inc, Household_objects.inc etc), all
called by a master file which place the items in space. Since I am getting
to the point of furnishing the house, I wanted to easily be able to
generate multiple views of the house so I could easily keep track of what I
needed to proceed in terms of furniture.  I set an animation loop where
each frame references a different set of camera and look_at coordinates.
From there, I set up an OLE document in my word processor that, with a
click of the mouse, replaced all 43 views of my interior with up-to-date
pictures.  This was not a problem.  I have it working great.  But
reciently, I rendered the animation loop, and it gave me a virtual memory
warning.  I am enough of a geek that I was mildly concerned.  My system,
while not exactly a power rig any more, should have been more than a match
for what I was doing.  I have a P2 350MHZ, 128 MB running Win2k Pro.  I
opened up the performance monitor supplied by Win2k and setup counters for
% Processor usage, Physical memory availible, % of Pagefile in use, and
number of pages per second.  I reran the animation series, and found the
pattern that has distressed me a touch.

From my understanding of the POV-Ray documentation, the animation loop works
something along the lines of: 1) Parse program 2)Render Picture 3) Write
image file, 4)purge and reset for next frame, 5) repeat through all frames.
 Thus, what I would expect this to translate to in terms of the performance
counters I had set up was:
1) the Processor usage should run maxed out.  It is either rendering or
parsing, both of which should be maxing out the processor, with perhaps
small breaks while it waits for the hard drive to write the image file.
2) Physical Memory should be in a cyclic, but constant, pattern, shrinking
during the parse as data is compliled, and regrowing as the frame is purged
before the next frame.
3)Pagefile should not be in excessive use because while I have a fairly
large codebase, it sure isn't the 90MB of physical memory or so Win2k
leaves me.

The pattern I found was
1) During normal rendering operations, the processor ran maxed out.  No Duh.
2) Physical memory was in a cyclic pattern, but it was not constant.  The
initial hit I took at the start of a frame cycle was around 20 MB (about
what I expected), but during the purge and reset phase, I was only
recovering ~14 MB.  Thus, over the life of the animation loop, I was slowly
eating up all my memory in this memory leak.  Oviously, as the animation
loop progressed, I reached levels where the pagefile was starting to be
needed, and the counters reflect this, showing an increase of use of
pagefile space.  Near the end of the animation loop, the swaping of memory
between physical memory and pagefile began to affect processor usage.  The
processor was dropping to mid-utilization while it did all the swapping
back and forth with the pagefile.  And at the end of the animation loop, I
noticed a long period (5min?) of time where POV seemed hung-up, but upon
looking at the counters, it was processing the contents of the pagefile. At
the very end of the animation loop, system resources are returned to
starting levels.

Now I come to the question that I need you folks for.  Do you think this is
a problem with the POV-Ray distribution, a small code leak compounded to
noticability by a large codebase parsing repeated over and over for the
animation?  Or is there some trick to the POV language I am ignorant of?  I
do alot of #declares, but I would think that those would be erased between
frames.  I use some loops, but again, any residue should be purged between
frames.  I cannot account for any other factors that would fit the facts.

I know this is a long post, and very technical.  However, I do not want to
harang the POV-Team with a "You got a problem, duuude" post until I can
eliminate myself and my work from the equation.  I just need some help
brainstorming possible flaws with my coding.  I have a screen capture of
the Performance monitor for anyone else who cares to interpret it, and if
it is nessesary, I can zap my code base off to someone for review.  Just
let me know what further information you need.

Thanks for the help,
Bosley
(dillender@#no-spam#bigmailbox.net)


Post a reply to this message

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