Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
0 registered members (), 1,012 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Memory Issue #342608
09/29/10 16:29
09/29/10 16:29
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Hi,
While testing our game we noticed that one player seems to get crashes very often. After checking the acklog.txt, it seems that there's always a "nexus overflow" towards the end of the file.

Now, the manual says that a nexus overflow can theoretically not crash the program, but aparrently directX can crash.
So I checked the Task Manager and noticed that the Amount of Memory used by the Program slowly increases over time.

How do I find these leaks? Is there an easy way or do I have to go through every str_create, pan_create ... (my program's rather long) and check?
And is this the reason my Program crashes?
Edit: and if so, why does it crash on a PC that has about the same amount of memory that I have?

Edit: One more thing... max_nexus is around 40960, while nexus is around 158646, so, around 4 times as much...

Last edited by Germanunkol; 09/29/10 16:47.

~"I never let school interfere with my education"~
-Mark Twain
Re: Memory Issue [Re: Germanunkol] #342849
10/01/10 15:42
10/01/10 15:42
Joined: Jun 2006
Posts: 2,640
Earth
Germanunkol Offline OP
Expert
Germanunkol  Offline OP
Expert

Joined: Jun 2006
Posts: 2,640
Earth
Does no one answering mean I have to go through every pan_create, str_create etc. manually? there's no way to make acknex output more info before the crash or something?
Darn. This will take me quite some time.


~"I never let school interfere with my education"~
-Mark Twain
Re: Memory Issue [Re: Germanunkol] #342863
10/01/10 16:44
10/01/10 16:44
Joined: Mar 2002
Posts: 1,774
Magdeburg
F
FlorianP Offline
Serious User
FlorianP  Offline
Serious User
F

Joined: Mar 2002
Posts: 1,774
Magdeburg
Memory is usually allocated in the stack f.i. when u define local variables the memory is freed after the function is terminated.
But if you allocate memory urself (with new, malloc or any create command) its stored in the heap - and you have to free it urself(with delete resp- engine objects with ptr_remove). Otherwise you get memory leaks.


I <3 LINQ
Re: Memory Issue [Re: FlorianP] #342872
10/01/10 17:09
10/01/10 17:09
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
I think that he knew that already wink

@Germanunkol: There are a few memory tracker, like Valgrind or Instruments. The down side: Non of these works on Windows. The first one is for UNIX and the the second one is for Mac OS. Another great thing would be D-Trace, but this needs kernel support (you could file an enhancement request at microsoft :P).

However, all the tools track only real leaks, but you still have A7/A8 as wrapper which releases everything allocated via xxx_create and sys_malloc at the end (at least it should).

But what you can do is the following: Create a macro with the name ent_create which takes all too parameters. This than calls a function that logs the creation (name of the file, action etc. so you can track the Entity created. Or! Say that you want the __FILE__ and __LINE__ macros. Than you can track the file and line that creates something.)
After you created the log entry, you can pass everything to the real xxx_create function. If you are done with testing, just remove the macros and everything is fine again laugh

Edit: Of course you should also overwrite the xxx_remove functions to track which objects stay alive even if they aren't used anymore.

Last edited by JustSid; 10/01/10 17:15.

Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1