|
-
Dec 8th, 2005, 10:22 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] Need advice on memory problem
Hi,
I have a large project that i am near completion of for a company, after adding one of the last forms to my project (as in and coding it) i get out of memory exceptions while running the program.
I did find out that i can increase memory allocation by uding the editbin utility, but that's not the best option.
I have started redesigning some forms to dispose data that isn't currently visible but this is only going to work to a certain extent as it's an MDI environment.
However the forms are quite graphical, and i could make more of them share background images.
Another thought that i am actually not sure of and need someone to help me with is DLL's, i do currently have 1 in my project, if i was to split it up more, does windows seperate their memory allocation? or is it all the same if everything in all DLL's is being used?
So what is the best option,
1. Use the utility
2. Do what i can with the graphics and remove some if neccessary
3. Split the App into DLL's
4. ?
Thanks
-
Dec 8th, 2005, 10:41 PM
#2
Re: Need advice on memory problem
Splitting the application up wont save memory since the needed parts will still be loaded into memory to be used. How many controls and graphics are you using? What size graphics and type? Do you get the out of memory exception in the same spot everytime. Sometimes Out Of Memory errors are caused unintentional recursive methods - or maybe those are StackOverFlow exceptions.
-
Dec 8th, 2005, 10:55 PM
#3
Thread Starter
Frenzied Member
Re: Need advice on memory problem
I am aware the DLL's would still be loaded in memory, however whether or not windows classes it as my programs allocation or its own is another issue. Or is that what you were saying, it doesnt.
The graphics are drawn at runtime to stylise all the forms, i think i may be able to reduce the amount of memory used there by saving images into an array and recalling them if they are apply to the next form, ei image1 fits form1 and 2, as opposed to drawing 2 images. I think this is a measure i will be taking anyway, how effective it will be i am not sure, as alot of the issue is with data.
The memory exception occurs when having the client form "which holds a large list of clients" and the auditor code form open "which shows a large list of codes", but surely it will occur with other combinations of forms too, perhaps i can force the closing of a particular form if they wish to use another large form (although that kind of defeats the idea of MDI)
-
Dec 8th, 2005, 11:06 PM
#4
Re: Need advice on memory problem
Yes I am saying it doesn't matter who allocates the memory. Besides that the DLL would still be loaded into the application's memory space.
A profiler of some kind might also help.
Here is a free one for the .NET CLR (but it isn't the greatest), but it can tell you which parts of your application take the most memory.
http://www.microsoft.com/downloads/d...displaylang=en
http://www.microsoft.com/downloads/d...displaylang=en
Extra stuff
http://www.theserverside.net/news/th...hread_id=31984
-
Dec 8th, 2005, 11:36 PM
#5
Thread Starter
Frenzied Member
Re: Need advice on memory problem
Thanks alot!
this profiler is great, it seems my drawing operations aren't taking much memory at all, it's majority Strings and Bytes that are chewing my memory.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|