how to find out the codes who eat up my memory?
-
i have a appilcation consists of thousands lines of code. when i do some specific operation, i.e. open a very large document, the app almost eats up my memory. but after a while, the memory is given back. i have tested the codes and found no memory leak. so, my problem is how to find the codes who eat up my memory. any one can help me?
-
i have a appilcation consists of thousands lines of code. when i do some specific operation, i.e. open a very large document, the app almost eats up my memory. but after a while, the memory is given back. i have tested the codes and found no memory leak. so, my problem is how to find the codes who eat up my memory. any one can help me?
-
i have a appilcation consists of thousands lines of code. when i do some specific operation, i.e. open a very large document, the app almost eats up my memory. but after a while, the memory is given back. i have tested the codes and found no memory leak. so, my problem is how to find the codes who eat up my memory. any one can help me?
Falconapollo wrote:
so, my problem is how to find the codes who eat up my memory.
Are you using the
new
operator?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
-
Falconapollo wrote:
so, my problem is how to find the codes who eat up my memory.
Are you using the
new
operator?"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
yes. but there is no memory leak in my codes as i wrote in my post.
-
yes. but there is no memory leak in my codes as i wrote in my post.
Are you allocating memory to hold the "very large document?"
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
-
Are you allocating memory to hold the "very large document?"
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
i'm not sure. since the codes are huge. i have no idea to find out the problematic codes. so, what's your recommendations? i think there are some existing tools to do that. do you know some?
-
i have a appilcation consists of thousands lines of code. when i do some specific operation, i.e. open a very large document, the app almost eats up my memory. but after a while, the memory is given back. i have tested the codes and found no memory leak. so, my problem is how to find the codes who eat up my memory. any one can help me?
The C# garbage collector is non-deterministic, which means it runs somewhat "randomly". It can produce this behavior even if there are no memory leaks in your application. It just delays collecting the disposed memory until it needs it. You can, however, explicitly invoke the garbage collector from your code:
System.GC.Collect ();
"Microsoft -- Adding unnecessary complexity to your work since 1987!"
-
i have a appilcation consists of thousands lines of code. when i do some specific operation, i.e. open a very large document, the app almost eats up my memory. but after a while, the memory is given back. i have tested the codes and found no memory leak. so, my problem is how to find the codes who eat up my memory. any one can help me?
First, when you do a malloc or new, you extend the heap. For optimization reasons, the memory manager may not return the heap back to the OS immediately. When needing to allocate especially large chunks of memory, you can use a low level API directly or, with some compilers/CRTs, a different heap (for Windows, here's an article discussion various options: http://msdn.microsoft.com/en-us/library/windows/desktop/aa366533%28v=vs.85%29.aspx[^].) Also note that if you allocate memory and sit around, the OS may page it out. To understand the difference in Windows, look into "private bytes" and "working set".
-
i have a appilcation consists of thousands lines of code. when i do some specific operation, i.e. open a very large document, the app almost eats up my memory. but after a while, the memory is given back. i have tested the codes and found no memory leak. so, my problem is how to find the codes who eat up my memory. any one can help me?
most of the time this problem is due to memory leak u check it again also check may be there is some large array defined in the code.like int arr[1024*1024][1024*1024].
-
i have a appilcation consists of thousands lines of code. when i do some specific operation, i.e. open a very large document, the app almost eats up my memory. but after a while, the memory is given back. i have tested the codes and found no memory leak. so, my problem is how to find the codes who eat up my memory. any one can help me?
application verifier is a good start.