|
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?
|
|
|
|
|
Apart from debugging, adding logging to your application or running some code analyzer[^] there is no answer.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
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.
|
|
|
|
|
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?
|
|
|
|
|
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".
|
|
|
|
|
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].
|
|
|
|
|
application verifier is a good start.
|
|
|
|
|
I want to ask you something: what would you use for image processing and more important, convert images from an format to other ? I am using MFC, and I was thinking of GDI+, but I didn't find so many examples to how to convert images ...
I see here so interesting controls, CBitmapEx, CxImage, CImageStone, but I don't know what is proper to do the job ... I will appreciate any hint.
Thank you for your time.
|
|
|
|
|
Did you look into Bitmap.ConvertFormat() [^] in GDI+?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
No, I didn't look over by now ... Thank you for your interest, so you suggest to use GDI+ ... I didn't try to load some not common image file, .raw, .tiff multipage, etc. ... I don't know if does function ...
|
|
|
|
|
Flaviu2 wrote: so you suggest to use GDI+ No, I just asked if you had looked at that function and if it solved your problem. Your question is not particularly clear, i.e. what do you want to convert from, and what do you want to convert to? I am sure that Google could find you lots of information if you were more specific about your requirements.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
No, I didn't solved yet. I want a class/library that could convert from an image format to many kinds of image formats ...
|
|
|
|
|
Then you need to do some research (using Google) to find one.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I was looking here[^], I think this is what I need it ... thank you for your time.
|
|
|
|
|
there are many libraries out there.
coughcough
|
|
|
|
|
The Win32 API offers very limited image conversion. There are many third party libraries, some free, others not. I'm currently looking at CxImage to replace Leadtools, which is now even more expensive than before and isn't royalty free. If you are willing to pay more, one royalty free library I've used is http://www.gdpicture.com/[^]. The ActiveX part always annoyed me, but it had a good PDF viewer component, so I lived with it. I'm also going to evaluate http://www.data-tech.com/products/imaging/imageman-dll.aspx[^]. (I work for none of these companies.)
|
|
|
|
|
If you are interested in audio development, I made a simple SDK to tag audio libraries patches. There is ton of things people are waiting for on this topic:
- analyze a WAV file and extract tagging informations (Percussive, Smooth ...)
- extract informations from REX files and convert them in tags
Plug-ins can be .NET assemblies or native DLL
as Universal Patch Finder is free,
the idea is to let all of this entirely free.
|
|
|
|
|
This is the wrong place. If you wish to promote your code then write an article about it and submit it to the Articles[^] section.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I code an app in C# , how to detect the window event such User Log On, Log Off, Standby ...
Please give a sample code.
Thanks.
|
|
|
|
|
vunhutien wrote: I code an app in C# This is the C++ forum.
vunhutien wrote: Please give a sample code. Sorry, we do not provide code to order.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Hi,
I am attempting to write and OLE program to access excel workshhets
in all the examples I have seen the first statement seems to define
_ApplicationPtr e.g. EXCEL:: _ApplicationPtr ptra or EXCEL:: _ApplicationPtr ptrb
My question is where is _ApplicationPtr defined
Thanks
|
|
|
|
|
The clue is in EXCEL:: which says that _ApplicationPtr is a member of the class EXCEL.
Ergo, the definition of the EXCEL class is where you should look.
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Where would I find the class defination of excel usally when I google msdn and the class name the first hit is a defination of the class name
thanks
|
|
|
|