There's no memory leak in my code(rather sure), then how to find out those codes who eat up my memory?
-
Now, I have a VC++ project which will occupy 1.5 G memory(the peak value), and then it will give back memory in 5 minutes. But, I want to optimize the memory usage, because 1.5 G is too huge. Besides, I'm rather sure there are no memory leaks in my codes, I have tested my codes with 3 tools(PurifyPlus, Debug Diagnostic and CMemoryState function). Anybody can help me? Or are there some tools to help me to do that? Again, I must emphasize 'there are no memory leaks in my codes, I'm rather sure'. So, don't mention 'memory leaks' in the comments. PS: I'm using Visual C++ 2010. And my project is made up of about 1400k lines of code.
-
Now, I have a VC++ project which will occupy 1.5 G memory(the peak value), and then it will give back memory in 5 minutes. But, I want to optimize the memory usage, because 1.5 G is too huge. Besides, I'm rather sure there are no memory leaks in my codes, I have tested my codes with 3 tools(PurifyPlus, Debug Diagnostic and CMemoryState function). Anybody can help me? Or are there some tools to help me to do that? Again, I must emphasize 'there are no memory leaks in my codes, I'm rather sure'. So, don't mention 'memory leaks' in the comments. PS: I'm using Visual C++ 2010. And my project is made up of about 1400k lines of code.
-
Falconapollo wrote:
Anybody can help me?
With what? All we know is that your application uses a lot of memory.
Use the best guess
Because there are lots of codes, so I want to find some tools to help me. It's alomost impossible to find out the problematical codes manually.
-
Because there are lots of codes, so I want to find some tools to help me. It's alomost impossible to find out the problematical codes manually.
-
Now, I have a VC++ project which will occupy 1.5 G memory(the peak value), and then it will give back memory in 5 minutes. But, I want to optimize the memory usage, because 1.5 G is too huge. Besides, I'm rather sure there are no memory leaks in my codes, I have tested my codes with 3 tools(PurifyPlus, Debug Diagnostic and CMemoryState function). Anybody can help me? Or are there some tools to help me to do that? Again, I must emphasize 'there are no memory leaks in my codes, I'm rather sure'. So, don't mention 'memory leaks' in the comments. PS: I'm using Visual C++ 2010. And my project is made up of about 1400k lines of code.
-
Now, I have a VC++ project which will occupy 1.5 G memory(the peak value), and then it will give back memory in 5 minutes. But, I want to optimize the memory usage, because 1.5 G is too huge. Besides, I'm rather sure there are no memory leaks in my codes, I have tested my codes with 3 tools(PurifyPlus, Debug Diagnostic and CMemoryState function). Anybody can help me? Or are there some tools to help me to do that? Again, I must emphasize 'there are no memory leaks in my codes, I'm rather sure'. So, don't mention 'memory leaks' in the comments. PS: I'm using Visual C++ 2010. And my project is made up of about 1400k lines of code.
-
Now, I have a VC++ project which will occupy 1.5 G memory(the peak value), and then it will give back memory in 5 minutes. But, I want to optimize the memory usage, because 1.5 G is too huge. Besides, I'm rather sure there are no memory leaks in my codes, I have tested my codes with 3 tools(PurifyPlus, Debug Diagnostic and CMemoryState function). Anybody can help me? Or are there some tools to help me to do that? Again, I must emphasize 'there are no memory leaks in my codes, I'm rather sure'. So, don't mention 'memory leaks' in the comments. PS: I'm using Visual C++ 2010. And my project is made up of about 1400k lines of code.
Falconapollo wrote:
Or are there some tools to help me to do that?
Profilers will identify memory usage.
Falconapollo wrote:
Again, I must emphasize 'there are no memory leaks in my codes, I'm rather sure'
Which doesn't mean that memory is not being used incorrectly. For example some sort of map with duplicate data. Normally, at least for me, I have a fairly good idea of why an application uses code. There are of course only two real sources. First if you have something, one thing, that it is in fact big. And the second is if you have a whole lot of little things. Rather hard to code an application without actually knowing which of those cases is likely.
-
Now, I have a VC++ project which will occupy 1.5 G memory(the peak value), and then it will give back memory in 5 minutes. But, I want to optimize the memory usage, because 1.5 G is too huge. Besides, I'm rather sure there are no memory leaks in my codes, I have tested my codes with 3 tools(PurifyPlus, Debug Diagnostic and CMemoryState function). Anybody can help me? Or are there some tools to help me to do that? Again, I must emphasize 'there are no memory leaks in my codes, I'm rather sure'. So, don't mention 'memory leaks' in the comments. PS: I'm using Visual C++ 2010. And my project is made up of about 1400k lines of code.
As Richard said it's impossible to give accurate advice without seeing your code and the functions you call from third party libs (and of course posting 1400k lines of code is not an option). The questions you should try to answer for yourself are: 1. Can you pinpoint certain operations (at user interface level) of your applications that result in high memory use? 2. Which internal parts (functions) of your application do require large amounts of memory, even if only temporary? 3. Which calls to third party libraries result in allocation of memory that is not automatically released (e. g. functions that create large objects or data sets to hold results)? 4. What third party libraries do you use, and what do you know about their memory allocation scheme? The last question is targeted at libraries that use their own memory managers, which may or may not release unused memory blocks in a timely manner. Find the answers to these questions to better locate possible causes for your problem. Without that info, nobody can really help.
-
Now, I have a VC++ project which will occupy 1.5 G memory(the peak value), and then it will give back memory in 5 minutes. But, I want to optimize the memory usage, because 1.5 G is too huge. Besides, I'm rather sure there are no memory leaks in my codes, I have tested my codes with 3 tools(PurifyPlus, Debug Diagnostic and CMemoryState function). Anybody can help me? Or are there some tools to help me to do that? Again, I must emphasize 'there are no memory leaks in my codes, I'm rather sure'. So, don't mention 'memory leaks' in the comments. PS: I'm using Visual C++ 2010. And my project is made up of about 1400k lines of code.
If the memory is returned, then it's not leaking. If you had a leak, then then the memory usage would keep growing until your application crashes. If you want your application to use less memory, then you'll have to look at how you use your data and the lifetime in which you keep it.