Jump to content
Sign in to follow this  
lorenkinzel

Ram use in Shell.Explorer.2

Recommended Posts

lorenkinzel

I've been working on a specialized browser using Shell.Explorer.2

I use it to view lots of sites in succession.

When I do this the ram usage by the script gets bigger & bigger with each site viewed.

I got the same thing using firefox & the ram use dropped when I cleared recent history. So I looked through the forums & added a button to clear temp. internet files.

I'll keep the button, but the ram use remains really high after viewing lots of sites, so it would appear that the coders at firefox may know just a wee bit more than I do. :graduated:

If anyone knows the answer, I would appreciate keywords & pointers (as opposed to just doing the work for me).

Thanks.

Edit: after more searching through the forums, I found:

Func _ReduceMemory($i_PID = -1)
    If $i_PID <> -1 Then
        Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
        $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
        DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
    Else
        $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
    EndIf
    Return $ai_Return[0]
EndFunc   ;==>_ReduceMemory

and added a call to this function to the browsers' "back" button. It works quite nicely. ;)

The lesson we (or I) learn is: whatever the problem, you are probably not the very first to experience it.

Modify search-terms & look again.

Edited by lorenkinzel

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×