Joined: |
May 3, 2008 02:00 PM |
Last Post: |
May 5, 2008 12:01 PM |
Last Visit: |
May 5, 2008 12:01 PM |
Website: |
|
Location: |
Chicago |
Occupation: |
Computer Programmer |
Interests: |
|
|
AIM: |
|
ICQ: |
|
MSN IM: |
|
Yahoo IM: |
|
|
jerry walton has contributed to 3 posts out of 21251 total posts
(0.01%) in 6,000 days (0.00 posts per day).
20 Most recent posts:
I got this figured out.
It seems that a program using the NxCoreAPI.dll to process a tape, will grow in memory usage up to about 45-50 MB and then "top off".
I was stopping the program prior to that point because I was unsure if there was some responsibility on my part to free the memory used by the messages.
I figured that since the memory was allocated in the NxCoreAPI.dll that is was the responsibility of the dll to de-allocate/free the memory.
The documentation makes no mention of responsibility for freeing memory used by messages or the fact that it will grow to a certain point and then catch up.
I thought about it and since the NxCoreAPI is a DLL, then it is probably a not a good idea to delete an object (memory) that was allocated by the DLL.
what I am experiencing is that when running SampleOne.cpp to process a tape and displaying a simple counter - that the program memory just gorws and grows until eventually the program crashes because it runs out of memory.
so what is the correct way to handle the freeing of resources?
it there anything to code to fix this problem?
I am running the NxCoreAPI sample program (SampleOne) with Visual C++ 2008 Express Edition.
I have read all the documentation and the sample programs and did NOT find a single delete statement anywhere?
who is responsible for deleting the messages received in the callback?
int __stdcall nxCoreCallback(const NxCoreSystem* pNxCoreSys, const NxCoreMessage* pNxCoreMsg)
who deletes pNxCoreSys and pNxCoreMsg? when can these be deleted?
|
|