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.

DarkBASIC Professional Discussion / DBPro Memory Leaks

Author
Message
sladeiw
9
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 13th Apr 2019 11:47
I'm still supporting an old application created with DBPro which is used every day for 8+ hours. The problem is the memory footprint increases over the day as (I assume) memory leaks within DBPro accumulate. This means occasional restarts to keep it stable. I have tried recompiling with 9EX but while it compiles fine there are too many issues to go back and fix. (100k+ lines of code) So... Is there a list or information on any particular commands or structures that contribute to memory leaks so I could possibly work around them. This is a desktop utility app, not a game, so no 3D commands are used. Thanks
tiresius
16
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 14th Apr 2019 05:17
Do you use user defined types that get deleted while containing strings? Some kind of "free string" command is only thing I remember language-based that was needed as a workaround for memory problems.
Maybe undim also had trouble, I'm not sure.
Kuper
11
Years of Service
User Offline
Joined: 25th Feb 2008
Playing: Planescape:Torment
Posted: 14th Apr 2019 11:47
Some memory leaks issues were find - also all of them were fixed in DBProEx, as I think.
You can just search here on forums to find all list of them. I can remember memory leak when create/delete animation but there were more of them, for sure.
What troubles did you get when recompile with DBProEx ?
sladeiw
9
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 14th Apr 2019 22:53
"What troubles did you get when recompile with DBProEx ?"

It just didn't work reliably & crashed regularly. It would be a massive job to start debugging with 9EX. I can't stress how much of a huge undertaking it would be since the app works on large databases that could be corrupted in subtle ways. 9EX is great work and I would use it if I was starting on something new. Living with the existing known faults is preferable

"Do you use user defined types that get deleted while containing strings? Some kind of "free string" command is only thing I remember language-based that was needed as a workaround for memory problems.
Maybe undim also had trouble, I'm not sure."

Thanks, I do undim & redimm one UDT but only in a module in the app that very rarely gets used so fairly sure that's not contributing to the leak.
Ortu
DBPro Master
11
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 15th Apr 2019 19:53
Returning strings from functions without assigning the return to anything will leak



Copying a udt over another udt in whole that contains strings will leak

http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
tiresius
16
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 15th Apr 2019 20:59
It's hard to trace these.

You can get a windows dump file and go through it with a hex editor or other viewer and look for tons and tons of extra data that hopefully you will recognize.
Like the same or similar strings 100000x over in memory. If it's integer data stuck in an array that will be harder to look at.

You could also trap it out to text file on disk in the code and match up creates/deletes of your data. That would take a very long time to code and also review.
sladeiw
9
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 15th Apr 2019 23:11
@ortu - Thanks I found numerous times I blackholed a returned numeric from functions, but no strings

@tiresius - Yes that sounds extremely tedious!

Login to post a reply

Server time is: 2019-04-19 03:17:43
Your offset time is: 2019-04-19 03:17:43