POV-Ray : Newsgroups : povray.general : An observation of concern : Re: An observation of concern Server Time
9 Aug 2024 03:18:39 EDT (-0400)
  Re: An observation of concern  
From: Thorsten Froehlich
Date: 16 Oct 2000 14:44:53
Message: <39eb4ca5@news.povray.org>
In article <39eb2b09@news.povray.org> , Warp <war### [at] tagpovrayorg>  wrote:

>   Yes, that kind of "self-made" memory management is of big help, of course.
>   What I wonder is that if that library can report unfreed memory at the
> end of the program, why there are memory leaks in povray?

Yes, this memory management will not only report the unfreed memory but also
free it, again depending on a compile-time setting.  Unfortunately this is
not possible after every frame of an animation (because some memory remains
allocated), so only after rendering is complete they will free the memory,
and only then any OS specific cleanup (or heap compacting) can take place.

Unfortunately very few patch authors seem to be aware of this capability and
so MegaPOV seems to leak a bit more than POV-Ray 3.1g (also, at least as far
as I know, there shouldn't be any leaks in the core code in 3.1g).

It is up to anyone to check, just add these defines to config.h and make
sure they are not set to 0 anywhere else.  Then do a full rebuild.

#define MEM_RECLAIM  1
#define MEM_TAG      1
#define MEM_TRACE    1
#define MEM_STATS    1

>   Btw, not freeing allocated memory in the right place but letting the
> library to do it is usually a sign of a bug.

Yes, and depending on the compile-time setting it will (hopefully) report
it.


     Thorsten


____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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