Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Memory Leak :(

Posted on 2001-08-16
8
Medium Priority
?
279 Views
Last Modified: 2011-09-20
If there are any guru's out there.....I can sure use a hand right about now.  I have a C++ app that interfaces with a VB app.  I use the C++ app to send remote commands to my VB app.  The VB app in turn replies with a response to the C++ app.  As far as I can tell at this point....if I send consecutive commmands remotely to the VB app....I receive virtual memory errors.  I have a process (that I view with task manager) that begins to grow in size exponentially until the virtual memory error occurs.  I realize this may be somewhat vague....but if anyone has any suggestions...it would sure be helpful.  


thanks,


saki
0
Comment
Question by:sakibomber
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 

Expert Comment

by:tsukko
ID: 6395012
Obviously you have some memory that you are not dealocating.  It probalby isn't a probablem in your vb program, that handles memory collection on it's own I believe, so you must have some dynamic variables in your c++ program that you are not deleting.  showing us some code would probably help.
0
 
LVL 3

Expert Comment

by:cwrea
ID: 6395271
Assuming you are using Visual C++, recompile a debug version of your program with the symbol _CRTDBG_MAP_ALLOC defined.  This will cause your program to use the debugging heap, which will tell you of any memory that was not deallocated when your program exits (including the location where it was allocated, and the size of the block).  You can also specifically make a call to _CrtDumpMemoryLeaks() at any point.

There are a number of other useful functions in the _CrtDebug* family.  They are all documented in MSDN.

Also - a number of tools exist to isolate these kinds of problems.  They include BoundsChecker and Purify.  They also find many other kinds of resource leaks and API problems.

I've found a combination of the above techniques effective.


0
 
LVL 2

Expert Comment

by:VCStud
ID: 6395779
Could you give some code over here. That would help to find the problem better
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 14

Expert Comment

by:DragonSlayer
ID: 6404784
perhaps you are using some strings that you allocated but did not free?
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 6405311
>>I use the C++ app to send remote commands to my VB app.  The VB app in turn replies with a response to the C++ app.  

Please describe the mechanism that you are using to communicate.  Are you using SendMessage?  PostMessage?  DDE?  Do you have an ActiveX object?  Is this an old-style "shared DLL" technique?

And please supply some code showing this mechanism.

-- Dan
0
 

Author Comment

by:sakibomber
ID: 6411893
Sorry everyone for the long delay.  Ive been knee deep in code.  From what I can tell....There is something funky happening with my SingleLock API.  I have multiple threads and somehow items are becoming 'deadlocked' within the code.  Im not sure if they are being Locked more than once, and then released...so when the other API call attempts to release it...its already gone.  Hmm..


I really have no idea at this point.  I would display the code...but I dont think I can fit all 50000 lines in here. :)


saki
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 800 total points
ID: 6414494
I think that 40,000 lines or so should be more than enough.

But here's another idea.  Why not spend a moment and describe the problem?  This is not PE (Psychics-Exchange) where we can read your mind across vast distances.

-- Dan
0
 

Author Comment

by:sakibomber
ID: 6441440
Ha ha ha......Sorry, I know you guys arent mind readers.  This was a very difficult question to ask because I wasnt sure where the source of the problem was.  I managed to isolate the problem and I think there is a solution in the works.


thanks everyone.



saki
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question