Opened 18 years ago

Closed 18 years ago

Last modified 2 years ago

#468 closed defect (invalid)

Memory Leaks

Reported by: SF/trinity78 Owned by: SF/ender
Priority: normal Component: --Other--
Keywords: Cc:
Game:

Description

latest daily build 15. sept. 2002. OS: Win2000 Adv. Server. Checked with "Day of the Tentacle", played the intro for 10-20 seconds then exited. I've used numegas boundschecker for this. I'm not sure if boundschecker works 100 % perfect.

1.) main.cpp 52 bytes allocated code: scummcfg = new Config (scummhome, "scummvm");

2.) map.h 52 bytes allocated code: node = new Node(key, prevNode);

3.) str.cpp 4 bytes allocated code: _refCount = new int(1);

5.) str.cpp 21 bytes allocated code: _str = (char *)calloc(1, _capacity+1);

6.) map.h 40 bytes allocated code: _header = new Node();

7.) str.h 4 bytes allocated code: String() : _capacity(0) { _refCount = new int(1); }

8.) map.h 52 bytes allocated code: _header = new Node();

9.) gameDetector.cpp 16 bytes allocated code: String() : _gameDataPath = strdup(val);

11.) imuse.cpp 4 bytes allocated code: IMuse *i = new IMuse;

12.) gameDetector.cpp 16 bytes allocated code: _gameDataPath = (char *)malloc((strlen (slashless) + 2) * sizeof(char));

13.) sdl.cpp 176 bytes allocated code: return new OSystem_SDL_Normal();

14.) mididrv.cpp 32 bytes allocated code: return new MidiDriver_WIN();

15.) enigne.cpp 11356 bytes allocated code: engine = new Scumm_v6(detector, syst);

15.) enigne.cpp 160 bytes allocated code: _mixer = new SoundMixer();

16.) mixer.cpp 512 bytes allocated code: _volumeTable = (int16 *)calloc(256 * sizeof(int16), 1);

17.) scummvm.cpp 3592 bytes allocated code: _gui = new Gui();

18.) scummvm.cpp 84 bytes allocated code: _timer = new Timer(this);

19.) resource.cpp 40 bytes allocated code: res.address[id] = (byte **)calloc(num, sizeof(void *));

20.) resource.cpp 84 bytes allocated code: _timer = new Timer(this);

21.) resource.cpp 10 bytes allocated code: res.flags[id] = (byte *)calloc(num, sizeof(byte));

21.) resource.cpp 50 bytes allocated code: _arrays = (byte *)calloc(_numArray, 1);

22.) scummvm.cpp 30636 bytes allocated code: _bundle = new Bundle();

22.) scummvm.cpp 1300 bytes allocated code: _sound = new Sound(this);

23.) imuse.cpp 5096 bytes allocated code: IMuseInternal *i = new IMuseInternal;

24.) imuse.cpp 360 bytes allocated code: driv = new IMuseGM(midi);

25.) resource.cpp 4166 bytes allocated code: CHECK_HEAP ptr = (byte *)calloc(size + sizeof (MemBlkHeader) + SAFETY_AREA, 1);

26.) scummvm.cpp 11520 bytes allocated code: _actors = new Actor[MAX_ACTORS];

27.) sound.cpp 8 bytes allocated code: File * file = new File();

28.) resource.cpp 256 bytes allocated code: _shadowPalette = (byte *)calloc (_shadowPaletteSize, 1);

29.) resource.cpp 800 bytes allocated code: _objectOwnerTable = (byte *)calloc (_numGlobalObjects, 1);

30.) resource.cpp 800 bytes allocated code: _objectStateTable = (byte *)calloc (_numGlobalObjects, 1);

31.) resource.cpp 3200 bytes allocated code: _classData = (uint32 *)calloc(_numGlobalObjects, sizeof(uint32));

32.) resource.cpp 100 bytes allocated code: _newNames = (uint16 *)calloc(_numNewNames, sizeof(uint16));

33.) resource.cpp 160 bytes allocated code: _inventory = (uint16 *)calloc(_numInventory, sizeof (uint16));

34.) resource.cpp 1500 bytes allocated code: _verbs = (VerbSlot *)calloc(_numVerbs, sizeof (VerbSlot));

35.) resource.cpp 5600 bytes allocated code: _objs = (ObjectData *)calloc(_numLocalObjects, sizeof(ObjectData));

36.) resource.cpp 1600 bytes allocated code: _vars = (int16 *)calloc(_numVariables, sizeof (int16));

37.) resource.cpp 256 bytes allocated code: _bitVars = (byte *)calloc(_numBitVariables >> 3, 1);

38.) resource.cpp 397 bytes allocated code: res.roomno[id] = (byte *)calloc(num, sizeof(byte));

39.) resource.cpp 1588 bytes allocated code: res.roomoffs[id] = (uint32 *)calloc(num, sizeof (uint32));

according to boundschecker all this allocated but never freed.

Ticket imported from: #610013. Ticket imported from: bugs/468.

Attachments (1)

scummvm-memory-leaks.txt (3.8 KB ) - added by SF/trinity78 18 years ago.
same text but just in a file

Download all attachments as: .zip

Change History (7)

by SF/trinity78, 18 years ago

Attachment: scummvm-memory-leaks.txt added

same text but just in a file

comment:1 by SF/trinity78, 18 years ago

oops, number 4 is missing and the numbers 21, 22 are double, sorry just dont pay attention to my counting.

a little bit unconcentrate :)

comment:2 by fingolfin, 18 years ago

Actually, many of those are not really memory leaks - we simply do not release all memory manually before exiting. Reason: doing so adds a lot of work, while slowing us down and gaining us nothing, as the system automatically will release our complet heap for us when we exit.

If you want to make a useful leak check, then (if your tool supports it), start the checking after a couple of secs (i.e. when the game is already running).

Saying that, the only possible gain by calling free()/delete would be that it makes it easier to use leak finders <g>. I'll try to do a little bit in this direction.

comment:3 by SF/trinity78, 18 years ago

I'm not that sure as you are, that the system automatically releases the complete heap. Because you are a lot more experienced with c/c++ memory management and know the source much better than me, I'm going to believe you. I justed posted this in the hope that it helps you, what you make out of it is your decision. If you think its useless, close it. :)

comment:4 by SF/ender, 18 years ago

Owner: set to SF/ender
Resolution: invalid
Status: newclosed

comment:5 by SF/ender, 18 years ago

I'm going to close this... as (and I'm sorry to say it trin :) boundschecker is a useless program, and pretty much every one of these is a phantom.

comment:6 by digitall, 2 years ago

Component: --Unset----Other--
Note: See TracTickets for help on using tickets.