Re: [Plib-devel] Memory leaks, was: GL_COLOR_MATERIAL pitfall
Brought to you by:
sjbaker
From: Wolfram K. <w_...@rz...> - 2000-05-01 12:06:43
|
Michael wrote: >This is getting rather off topic from the list, unless everyone wants to >read about memory management and auto garbage collectors. True, and now it may even get religious :-/, so lets be carefull. >Obviously nothing beats paying attention to what you are doing. The two obvious disadvantages to the manual way is the huge time amount it takes and the possibilty to create bad bugs, for example, in an esoteric circumstance you might free something that isnt created. I have to admit so, that such errors are very rare. >Perhaps it's simply >different schools of thought. I write 3D applications that need performance. So do I, I wrote a modeler. However, this only sometimes needs to be fast, often it is waiting for the user (I dont redraw the screen if nothing is happening). I use a gc for the objects of some classes. I call the gc in the "OnIdle-routine", which is called when the CPU has nothing better to do. I think this uses very little CPU-time that could be spend on other things, but I never did measurements. Also, it is clear that this approach doesnt work for, say a flight simulator. >For me, personally, the overhead of garbage collection is not worth it - I >would rather identify the flaws in my code and eliminate them. Just out of curiosity: How large is your program, have you eliminated all/most memory leaks and how much time did it take? My answers: 100k lines, no/no, maybe 10%, but I could spend MUCH more. >-Michael Kurth Bye bye, Wolfram. |