Memleak: Heightmaps with setHardwareMappingHint

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Valmond
Posts: 308
Joined: Thu Apr 12, 2007 3:26 pm

Memleak: Heightmaps with setHardwareMappingHint

Post by Valmond »

Hi!

I nailed down a mem leak when reloading Terrains in my game and it happens when I use

Code: Select all

terrain->getRenderBuffer()->setHardwareMappingHint(scene::EHM_DYNAMIC);
Easily reproduced in the tutorial.


I'm on Irrlicht 1.5, maybe this isn't an issue any longer but I thought I'd better tell...
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

How did you test that it's a mem leak? I'm still pretty sure that in most cases these are false positives, as the ressources are still known to the driver, but only released after program shutdown.
Valmond
Posts: 308
Joined: Thu Apr 12, 2007 3:26 pm

Post by Valmond »

It might be that because I just checked how much memory usage the .exe has.

If it gets really high, does Irrlich free up some memory?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

No, Irrlicht simply does not allocate memory in advance, hence also no freeing in between.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

I could swear that I had recently traced this leak down. It had something to do with the HWBufferLink not getting deallocated. I provided a diagnosis, a testcase, and a workaround. I can't seem to find the post anywhere.

Update: I found it here.

Travis
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, my answer to that post is then either neglected, or silently considered wrong?! Moreover, having a pointer to an allocated memory area stored somewhere is definitely not a mem leak. As you said, this buffer is automatically deallocated, it's just a question whether this happens in a reasonable amount of time or not.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Right. I was pointing out the fact that the issue had been previously discovered, described and worked around. Instead of saying 'there is no leak', you get to say 'it may look like a leak, but it is not a leak and here is why. Users tend to appreciate having things explained so that they understand them.

Travis
Post Reply