POV-Ray : Newsgroups : povray.unofficial.patches : Major bug in MegaPOV Plus? Server Time
2 Sep 2024 16:19:00 EDT (-0400)
  Major bug in MegaPOV Plus? (Message 12 to 21 of 81)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Chris Huff
Subject: Re: Major bug in MegaPOV Plus?
Date: 6 Sep 2000 13:20:08
Message: <chrishuff-A5A55D.12215206092000@news.povray.org>
In article <39b66c38@news.povray.org>, Warp <war### [at] tagpovrayorg> 
wrote:

>   Strange. I don't use new anymore (except only in very few cases) since
> the STL is so handy.
> 
>   Why would I code dynamic vectors, trees and so on myself when someone
> much more expert than me has done it already? And besides, STL is a lot
> easier to use :)

Why would I use code from someone else for something as simple as a 
linked list or tree?
Ok, much of the problem is that I can't find a good reference about the 
best way to use the STL, and templates have been nothing but headaches 
to me.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Thomas Willhalm
Subject: Re: Major bug in MegaPOV Plus?
Date: 6 Sep 2000 13:26:06
Message: <qqmaedlbff5.fsf@ramsen.fmi.uni-konstanz.de>
"Rune" <run### [at] inamecom> writes:

> "Chris Huff" wrote:
> > Probably a memory leak,
> 
> I don't know exactly what a memory leak is, but I can tell you some more
> about how MP+ behaved in my case.
> 
> Well, I have this animation that doesn't use any MP+ features at all. When I
> render it in regular MP everything is fine and the peak memory used is about
> the same for every frame.
> But when I render the same animation in MP+ the peak memory used increases
> rapidly for every frame, like they are added together. 

This is exactly a memory leak: Memory, that has been allocated, is not
freed when it isn't used any more. That's why the program seems to use 
more and more memory during its run.

If you render only a single frame, all memory is freed (returned to the
operating system) when the program ends. By this the memory leak isn't
so apparent.

A "modern" explanation of memory leaks might go like this: Instead of
recycling memory it is thrown away. :-)

Thomas

-- 
http://www.thomas.willhalm.de/ (includes pgp key)


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Major bug in MegaPOV Plus?
Date: 6 Sep 2000 14:13:03
Message: <39b6892f@news.povray.org>
In article <chrishuff-A5A55D.12215206092000@news.povray.org> , Chris Huff 
<chr### [at] maccom>  wrote:

> Why would I use code from someone else for something as simple as a
> linked list or tree?

Because the someone else put a lot of R&D into it and optimised the code for
your platform, while you have to optimise it yourself otherwise...

> Ok, much of the problem is that I can't find a good reference about the
> best way to use the STL, and templates have been nothing but headaches
> to me.

Well, then just use trial and error.  Start with simple types like strings,
vectors and lists first.  Use them in simple cases, play around with them,
and whenever something does not work as expected, try to find out why, don't
just give up.   Don't be afraid, just try - that is how I got started with
it after reading Stroustrup's book :-)

As for books, there are a few in the Addison-Wesley Professional Computing
Series for example (yes, they are expensive, but you can learn a lot from
them, and some will surely be available in your local college library).

Of course there is the Stroustrup "The C++ Programming Language 3rd Ed."
which explains at least the basic types mentioned above well enough to use
them, and it also explains templates.  For understanding the complex object
oriented models behind lots of libraries (not just the STL, but also i.e.
most GUI frameworks) try the classic book "Design Patterns: Elements of
Reusable Object-Oriented Software".


     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

From: Mark Wagner
Subject: Re: Major bug in MegaPOV Plus?
Date: 7 Sep 2000 01:32:18
Message: <39b72862@news.povray.org>
Chris Huff wrote in message ...
>I suspect there are a couple leaks in the expression
>parsing functions, and maybe two which I added by mistake with the
>turbulence scale patch, but I seem to have been getting leaks since my
>first compile of MegaPOV 0.5a, so it isn't only my code at fault. There
>are probably dozens of small leaks scattered all over the source code.


Last year I went through POV-Ray for Windows (the SuperPatch version) and
got rid of every memory leak the memory-logging function could find.  Most
of the leaks were in SuperPatch features.  The ones I have the fixes for
are:

Spline memory leak
-- Add the following lines to the end of Destroy_Ident_Data
     case SPLINE_ID_TOKEN:
       Destroy_Spline((SPLINE *)Data);
       break;

Memory leak in File:C:\Temp\workarea\SOURCE\Matrices.c  Line: 986  Size:256
 --Problem occurs when a declared object (HF?) is scaled and then instanced
 -- THE BUG:  COPY_OBJECT_FIELDS copies the UV_Trans for an object, but
Copy_Object also does this.  The fix: remove the call in Copy_Object.

One warning about the memory log feature:  It results in about a 30%
slowdown in rendering SkyVase.  Be sure to turn it off when compiling a
release version.

Mark


Post a reply to this message

From: Jérôme Berger
Subject: Re: Major bug in MegaPOV Plus?
Date: 7 Sep 2000 05:10:00
Message: <39B75B67.66F949D8@enst.fr>
Chris Huff wrote:
> 
> Ok, much of the problem is that I can't find a good reference about the
> best way to use the STL, and templates have been nothing but headaches
> to me.
> 

	Two links for the STL:
http://codeguru.earthweb.com/cpp/stlguide/index.shtml
http://www.sgi.com/Technology/STL/

	And a genral book about C++ with (among other things) a good
introduction to templates:
http://codeguru.earthweb.com/cpp/tic/index.shtml


-- 

* Doctor Jekyll had something * mailto:ber### [at] inamecom
* to Hyde...                  * http://www.enst.fr/~jberger
*******************************


Post a reply to this message

From: Chris Huff
Subject: Re: Major bug in MegaPOV Plus?
Date: 7 Sep 2000 16:50:46
Message: <chrishuff-EA823D.15523107092000@news.povray.org>
In article <39b72862@news.povray.org>, "Mark Wagner" 
<mar### [at] gtenet> wrote:

> Last year I went through POV-Ray for Windows (the SuperPatch version) and
> got rid of every memory leak the memory-logging function could find.  
> Most of the leaks were in SuperPatch features.  The ones I have the 
> fixes for are:

I added these fixes to my version, thanks!

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Chris Huff
Subject: Re: Major bug in MegaPOV Plus?
Date: 7 Sep 2000 17:02:16
Message: <chrishuff-240B6F.16040107092000@news.povray.org>
In article <39b6892f@news.povray.org>, "Thorsten Froehlich" 
<tho### [at] trfde> wrote:

> Because the someone else put a lot of R&D into it and optimised the 
> code for your platform, while you have to optimise it yourself 
> otherwise...

Aw, takes all the fun out of it! ;-)


> Well, then just use trial and error.  Start with simple types like 
> strings, vectors and lists first.  Use them in simple cases, play 
> around with them, and whenever something does not work as expected, 
> try to find out why, don't just give up.   Don't be afraid, just try 
> - that is how I got started with it after reading Stroustrup's book 
> :-)

Ok...I will try. :-)
But you have seen CodeWarrior's error messages...not terribly 
descriptive. I spent most of my time in the "error" portion of "trial 
and error".

...misc book recommendations snipped...
Thanks, I will put these on my list of books to get.

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

From: Thorsten Froehlich
Subject: Re: Major bug in MegaPOV Plus?
Date: 7 Sep 2000 17:29:22
Message: <39b808b2$1@news.povray.org>
In article <chrishuff-240B6F.16040107092000@news.povray.org> , Chris Huff 
<chr### [at] maccom>  wrote:

> Ok...I will try. :-)
> But you have seen CodeWarrior's error messages...not terribly
> descriptive. I spent most of my time in the "error" portion of "trial
> and error".
>
> ...misc book recommendations snipped...
> Thanks, I will put these on my list of books to get.

Guess what, other compilers are even worse <sigh>   MrC and Visual C for
example...


      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

From: Thorsten Froehlich
Subject: Re: Major bug in MegaPOV Plus?
Date: 7 Sep 2000 17:30:49
Message: <39b80909$1@news.povray.org>
In article <chrishuff-240B6F.16040107092000@news.povray.org> , Chris Huff 
<chr### [at] maccom>  wrote:

> ...misc book recommendations snipped...
> Thanks, I will put these on my list of books to get.

See it this way:  If you plan to major in CS (if you do?) you will have to
get most of them sooner or later anyway ;-)


    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

From: Chris Huff
Subject: Re: Major bug in MegaPOV Plus?
Date: 7 Sep 2000 17:56:01
Message: <chrishuff-E9C8A0.16574607092000@news.povray.org>
In article <chrishuff-0559FE.12183706092000@news.povray.org>, Chris 
Huff <chr### [at] maccom> wrote:

> Thanks...I remember seeing this before, but it didn't occur to me that 
> it could be helpful in doing this.

Well, by using this logging feature, I was able to find a couple leaks 
and confirm some I had found before. Some of the leaks I haven't figured 
out how to fix yet are in the UseMediaAndLightCache patch, these 
variables are allocated but never released:
ShadowMediaListCacheSize
LightingMediaListCacheSize
MediaIntervalCacheSize

-- 
Christopher James Huff
Personal: chr### [at] maccom, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tagpovrayorg, http://tag.povray.org/

<><


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>

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