Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4331

[V8i C++] MstnElementSetTool and memory usage

$
0
0

I've begun twiddling with VS2005's memory state functions ( _CrtMemState ) to compare memory usage in an attempt to convince myself that my tools do/do not have memory leak issues. I get random occurrences of MicroStation crashes as I develop/test tools.

 

As a start, In a simple tool with MdlMain() and a keyin command to launch a tool, I  create a memory checkpoint ( _CrtMemCheckPoint() ) as soon as MdlMain() is entered and just before it finishes. Then a comparison is made ( _CrtMemDifferences() ). This comparison show things are OK (no differences found). Next I "unload" the app and again check the memory state (compare memory as MdlMain() is completed with the memory as found in my unload function). Again, no differences are found.

 

Finally, I repeat the test, this time by calling my skeleton MstnElementSetTool via a keyin (so the sequence is "mdl load myapp"; "myapp start mytool"; "mdl unload myapp") but this time, when the memory comparison is done in the unload function, a difference IS found ( reports "256 bytes in 1 Normal Blocks" ). Is there something that should be done to "release" the memory the MstnElementSetTool uses that maybe I'm not aware of and not performing?


Viewing all articles
Browse latest Browse all 4331

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>