tag:blogger.com,1999:blog-1757856588756891210.post240119393160757467..comments2023-02-23T05:24:13.336-08:00Comments on Online Game Techniques: What is a memory leak and why do we care?Darrin Westhttp://www.blogger.com/profile/08387670564219526228noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-1757856588756891210.post-35769582886919787062009-03-16T08:59:00.000-07:002009-03-16T08:59:00.000-07:00I've lived where you are (be clean) a long time an...I've lived where you are (be clean) a long time and have pushed for it to the point of irritating people. But I am beginning to question it because of the development cost.<BR/><BR/>Here's the thing. The "bloat" that you talk about where the system doesn't let go of references can be instrumented. How fat are your caches getting, how much space is taken up by the scene graph or textures. Because those blocks are "controlled", the app is able to do this (given foresight and diligence). And as you say those bloats might even be missed by traditional approaches because the caches are deleted at shutdown or whatever. So even with traditional leak detection, you need this kind of instrumentation.<BR/><BR/>I've shipped with leaks too, and used to swear I'd never do it again. But I bet it will happen because I (now) think it doesn't have great return on investment. Teams eventually give up on finding the last few leaks, fall off the wagon, and shrug.<BR/><BR/>Well. Even if your team decides to invest in the 100% solution, you should buy Purify. It will speed things up incredibly.<BR/><BR/>Now. Let's talk about debugging "leaked" reference counts. Heh. Another post is burbling.Darrin Westhttps://www.blogger.com/profile/08387670564219526228noreply@blogger.comtag:blogger.com,1999:blog-1757856588756891210.post-87964642189570579252009-03-15T10:33:00.000-07:002009-03-15T10:33:00.000-07:00Nice, but in most game and apps I've shipped the p...Nice, but in most game and apps I've shipped the problems weren't usually these "precise" or "traditional" leaks. They were logical faults were systems failed to let go of references when they should have. That could be between level loads, after initialization, etc.. To purify, these would all look valid. And, in hard to track cases, code that checks for leaks at app shutdown wouldn't catch them either since there was logic that cleaned them up them. <BR/><BR/>The negatives: over use of memory on consoles that have little, or worse, references to memeory that has been reclaimed.<BR/><BR/>I've shipped games using the philosophy of "kill the process, it'll clean up the memory". While it worked, there was strong consensus that we'd painted ourselves into that corner, and it wasn't a good place to be. I'd not do that again.Vincent Scheibhttps://www.blogger.com/profile/14142807255428586912noreply@blogger.com