Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Bug Reports / DGDK Memory leak with dbStr()

Author
Message
MiR
20
Years of Service
User Offline
Joined: 13th Jul 2003
Location: Spain
Posted: 2nd Oct 2005 20:52
dbStr causes a memory leak. MikeĀ“s got an email about it but just to be on the safe side. Could have got lost or whatever.


My signature has been erased by me because it's LARGE.
Thank you for the votez!1!
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 3rd Oct 2005 00:49
Yes, good idea to get it sorted now

Come to the third DarkBasic Pro Sci Fi Con - Be there and be square
Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 13th Feb 2006 17:24
This is not related exclusively to the GDK, or even DBPro, but the way DirectX Input handles controller devices. See the attached source code for DBPro which also shows the reserve of 32K every other second. You can also observe this behaviour (eats of 32K) by running the latest force feedback demo in the DirectX SDK. The reason I suspect is the allocation of buffers to hold captured input data, but the DirectX documentation does not elaborate on this. Certainly not a memory leak in regards to strings, as you will notice the source code below does not use the string commands. Direct Input is part of the basic keyboard/mouse/joystick DLL used by DBPro and so is integral to normal 3D executables.

"Small, smart, and running around the legs of dinosaurs to find enough food to survive, bedroom programmers aren't extinct after all "
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 14th Feb 2006 00:26
@Lee
I am not sure of what 32k you are talking about..

I tried your source code in DBPro and watched the memory usage in the task manager. In the first 2-5 seconds the memory goes up a little, also when hitting a key (not escape), or clicking with the mouse. But after some seconds the memory is stable, I don't see any memory leak.

Nevertheless, I think there is memory allocated that is not really used. why? when you minimize the window, and then resize it, the memory usage has drastically reduced..

I could not run the latest force feedback demo since I have no force feedback...

Nonetheless of this strange memory usage, I do believe that the originally posted memory leak is only due to the usage of dbStr(), which allocates bytes for the char-array, but never gets freed.

greets
Barnski.

-- I just started with DarkSDK, by translating DBP Projects. --

Login to post a reply

Server time is: 2024-04-27 20:47:57
Your offset time is: 2024-04-27 20:47:57