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.

Dark GDK / Memoryleak in ODE physics??

Author
Message
Zarillo
16
Years of Service
User Offline
Joined: 7th Aug 2007
Location: Finland
Posted: 7th Aug 2007 08:40
Hello,
I have a problem with the ODE physics (V 1.1) for DarkGDK.NET. When compiling and runing the C# example that is included in the download file the application keeps allocating memory.
Does anyone have the same problem and know how to solve this?
If not, any suggestions for any other physics engine I could use in the .NET version?

/All The Best,
Zarillo
www.3dstudio.fi
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 7th Aug 2007 12:43
Zarillo, let me look into it. It could just be that the ODE plugin is allocating memory for the simulation, but not freeing it.

Paul.

APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 7th Aug 2007 15:57
I have found allocations within the plugin, but I need to clarify that ODE either uses this data, or copies it into it's own allocated buffers. If the case applies to the latter, then I can free these buffers up which will hopefully resolve the memory usage problem.

Paul.

APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 18th Aug 2007 18:01
Zarillo,

After looking into this memory issue, There is a problem but I may need to talk to TGC about it. Basically, functions such as:

ODE_CreateStaticUniverse
ODE_CreateStaticTriangleMesh

Allocate large vertex data structures which are passed directly into ODE. Now ODE does not allocate memory again, but merely sets up const pointers into the vertex data that was allocated by the DBP (DGDK) plugin. What I can't determine yet is if and when ODE is asked to destroy a Geom, that it frees this memory itself, or it merely looses the pointer references. If the latter is the case, then yes, there is a memory issue. Basically I will probably need to add code to track all memory allocations in the plugin, and free them whenever the system destroys an ODE body, or free them altogether when the plugin is relinquished by the program.

Either way, I'm making progress.

Paul.

jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 22nd Aug 2007 21:00
@Apexnow, what is the vertex structure look like internally? 3 floats?

Login to post a reply

Server time is: 2024-05-02 00:45:45
Your offset time is: 2024-05-02 00:45:45