|
-
May 2nd, 2007, 01:46 AM
#1
Thread Starter
Hyperactive Member
Memory Leak problem, how to clear memory?
Does anyone have code to clear memory?
My program dies after a while of usage, i need to clear the memory after each process.... hrm...
-
May 2nd, 2007, 01:54 AM
#2
Re: Memory Leak problem, how to clear memory?
Well ways to reduce memory usage first off would be using instead of That is only when it is possible to use either.
I am not to certain as to how to clear the ram, exactly. But apparently there are some programs that use up as much ram as possible then clear it. There might possibly be an open source example some where my friend made one but he made a while back and doesn't have the source no more.
Last edited by Paul M; May 2nd, 2007 at 01:56 AM.
Reason: mis reasoning
-
May 2nd, 2007, 01:54 AM
#3
Thread Starter
Hyperactive Member
Re: Memory Leak problem, how to clear memory?
is there any way to restart a control without restarting the entire program? Like, restart webbrowser1 for example? Without killing the exe?
8 gigs/ram (hey why not)
300 gig HD x2
Windows XP 64
-
May 2nd, 2007, 01:57 AM
#4
Re: Memory Leak problem, how to clear memory?
I forget the exact functioning behind the refresh command but that should work. Example MSDN will tell you more
-
May 2nd, 2007, 02:00 AM
#5
Re: Memory Leak problem, how to clear memory?
It should just basically reload the UI(User Interface).
I wonder if instead of doing the following for every control
Code:
controlname.Refresh
If doing just...
will do the same thing? I believe it should
Last edited by Paul M; May 2nd, 2007 at 02:02 AM.
Reason: mistype
-
May 2nd, 2007, 02:01 AM
#6
Thread Starter
Hyperactive Member
Re: Memory Leak problem, how to clear memory?
Is there any way to restart a control without restarting the entire program? Like, restart webbrowser1 for example? Without killing the exe?
8 gigs/ram (hey why not)
300 gig HD x2
Windows XP 64
-
May 2nd, 2007, 02:04 AM
#7
Re: Memory Leak problem, how to clear memory?
Sorry for misleading you. But when i say reload i mean refresh but it doesn't close. Everything stays the same it just 'refreshes' it self
-
May 2nd, 2007, 02:20 AM
#8
Re: Memory Leak problem, how to clear memory?
We would have to see your code otherwise we will just make general suggestion like set your controls = nothing after usage. Most likely you create new objects and do not release them then create new objects.
Could be a number of things though...
-
May 2nd, 2007, 02:28 AM
#9
Thread Starter
Hyperactive Member
Re: Memory Leak problem, how to clear memory?
If possible I would like a way to "reset" or "restart" the webbrowser control....
8 gigs/ram (hey why not)
300 gig HD x2
Windows XP 64
-
May 2nd, 2007, 02:32 AM
#10
Re: Memory Leak problem, how to clear memory?
You will need to post your project or code to say the least...
-
May 2nd, 2007, 04:22 AM
#11
Thread Starter
Hyperactive Member
Re: Memory Leak problem, how to clear memory?
8 gigs/ram (hey why not)
300 gig HD x2
Windows XP 64
-
May 2nd, 2007, 05:26 AM
#12
Re: Memory Leak problem, how to clear memory?
Well, you could at least post some of your codes so that we can pinpoint the problem.
I can give you tips but this will not help much to the actual problems you're encountering.
Some tips i know...
Set it to New when instantiating objects. Instead of doing this
Code:
Dim aVariable As New Class.Description
do it like this
Code:
Dim aVariable As Class.Description
'will create a new instance
Set aVariable = New Class.Description
'Remove from memory
Set aVariable = Nothing
The general idea is to make sure all processes are properly disposed or terminated before exiting the program. Setting objects to nothing, unloading, etc etc.
-
May 2nd, 2007, 07:18 AM
#13
Thread Starter
Hyperactive Member
Re: Memory Leak problem, how to clear memory?
It's webbrowser control.
All events are triggered by the documentcomplete function. It loops...
That's why it takes a lot of memory.
The problem lies with webbrowser1...
8 gigs/ram (hey why not)
300 gig HD x2
Windows XP 64
-
May 2nd, 2007, 09:01 PM
#14
Thread Starter
Hyperactive Member
Re: Memory Leak problem, how to clear memory?
I would just like to clear the memory in general, is there any sample code around here?
-
May 2nd, 2007, 09:05 PM
#15
Re: Memory Leak problem, how to clear memory?
You really don't understand how this works...
-
May 3rd, 2007, 12:36 AM
#16
Frenzied Member
Re: Memory Leak problem, how to clear memory?
In Task Manager is your program using insane amounts of memory or what? Does it go up over time or stay the same?
-
May 3rd, 2007, 01:23 AM
#17
Re: Memory Leak problem, how to clear memory?
@erbio
You can't do anything about it. If you want to control the amount of memory usage then you create your own webbrowser and never rely on Iexplorer component control. Search on how to parse html if you have the guts to go nuts.
-
May 3rd, 2007, 05:16 AM
#18
Re: Memory Leak problem, how to clear memory?
Without seeing your code this is non-productive...
-
May 3rd, 2007, 09:50 AM
#19
Re: Memory Leak problem, how to clear memory?
He might be refering to the stack... if so erbio then you'll have to come up with another scheme (such as a queue?) for your procedure calls to keep them from exhausting the stack.
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
|