enigma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Enigma-devel] leak hunting - report


From: Petr Machata
Subject: [Enigma-devel] leak hunting - report
Date: Sat, 21 Jun 2003 20:52:40 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3; MultiZilla v1.4.0.2) Gecko/20030312

Today I kind-of finished leak hunting in Enigma code. My goal was to eliminate all leaks reported by Valgrind 1.9.4.

I wasn't able to remove all leaks. Valgrind claims that there are currenly some 250 KB leaked, and this leak occurs even if all you do is enter the game and exit immediately. If you play the game, even more memory disappears, up to 400 KB total. This is not *that* bad, remember that it was a lot more than a meg at the beginning. Yet it's a leak and leaks don't help.

I have absolutely no idea how is this possible. I went through whole code and found for each new it's corresponding delete. I placed logs to constructors and destructors, comparing amount of each. I found some leaks, that were not reported by Valgrind (plus one false alarm), but I wasn't able to remove reported leak. I don't know. Maybe there is bug in Valgrind, maybe there is a bug in libstdc++, possibly I just didn't look hard enough. Probably a bit of each. There are a leaks in SDL, X, LUA, but those are minor, a few bytes each. The major 250K-large block sticks hard.

By the way, Valgrinds report leaks even in this code. This is strange, does anyone know what is it?

        #include <string>
        int main() {
            std::string R = "hi!";
        }

Petr Machata






reply via email to

[Prev in Thread] Current Thread [Next in Thread]