Sign in to follow this  
Followers 0
jaxman

Freeing memory up

10 posts in this topic

Is it possible to free up the memory that the compiled script used :)

Share this post


Link to post
Share on other sites



add this function to your script and call the function

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)
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
        DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
    Else
        Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
    EndIf
    
    Return $ai_Return[0]
EndFunc;==> _ReduceMemory()

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

This is a good script but this is actually not what i'm looking for but thanx anyway.

Share this post


Link to post
Share on other sites

If you mean after the script has exited, I have utility that runs on my pc's called

FreeRam XP Pro

<{POST_SNAPBACK}>

is this a problem with autoit? memory not being automatically freed up? Just asking 'cause i hadn't noticed it before, but honestly never really looked either

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

Share this post


Link to post
Share on other sites

If you mean after the script has exited, I have utility that runs on my pc's called

FreeRam XP Pro

<{POST_SNAPBACK}>

There are lots of freeware utilities that does this but was wondering if it's possible with Autoit.

Share this post


Link to post
Share on other sites

is this a problem with autoit? memory not being automatically freed up?  Just asking 'cause i hadn't noticed it before, but honestly never really looked either

<{POST_SNAPBACK}>

I haven't either, but I use that for alot of other applications i.e. MS apps leave foot prints all over the place.

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Should make correction to that, if using the beta and DllStructs, and one forgets to delete the structs the memory is still used. There may be other instances where incorrect coding will result in memory not being freed up.

Gary


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Should make correction to that, if using the beta and DllStructs, and one forgets to delete the structs the memory is still used.  There may be other instances where incorrect coding will result in memory not being freed up.

Gary

<{POST_SNAPBACK}>

You're right forgot about that, thanx :)

Share this post


Link to post
Share on other sites

I haven't either, but I use that for alot of other applications i.e. MS apps leave foot prints all over the place.

<{POST_SNAPBACK}>

Microsoft programs wasting system resources?! Blasphemy. </sarcasm> Thanks for the response, i hadn't even considered possible side effects of not deleting structs etc, but luckily i don't use them much...

1100111 00001011101111 00011101101111 00010111100100 00001111110100 00110111110010 00101101111001 0011100i didn't make up this form of encryption, but i like it.credit to the lvl 6 challenge on arcanum.co.nz

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  
Followers 0