TalivanIBM Posted March 6, 2008 Share Posted March 6, 2008 (edited) I have create a little program, Gets the external IP and send it to an email, i declare many vars and i tried to erase it after some functions, but the program still took so many memroy. The program 400k after 1 of the function 2,3 mb after 2 function 3,4 mb and stay here, declaring all the unnecessary vars to 0 the memory haven't been released. well there is a way to free memory really, because declare the vars to 0 don't work for me Edited September 19, 2008 by TalivanIBM Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 6, 2008 Moderators Share Posted March 6, 2008 I have create a little program, Gets the external IP and send it to an email, i declare many vars and i tried to erase it after some functions, but the program still took so many memroy. The program 400k after 1 of the function 2,3 mb after 2 function 3,4 mb and stay here, declaring all the unnecessary vars to 0 the memory haven't been released. well there is a way to free memory really, because declare the vars to 0 don't work for meRun this after you make your Variables the value of "". 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 ;==>_ReduceMemorySee if that relieves some it. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Uriziel01 Posted March 6, 2008 Share Posted March 6, 2008 Try to create more Variables in Local, use _ReduceMemory as SmOke_N said. If you must use Globals try playing with _MemGlobalFree($hMem) (i dunno if it works good, I have never used It), also you must now that $variable=0 clears memory only for Arrays. Link to comment Share on other sites More sharing options...
TalivanIBM Posted September 19, 2008 Author Share Posted September 19, 2008 Thank you, the function is really cool, works very fine. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 19, 2008 Moderators Share Posted September 19, 2008 Thank you, the function is really cool, works very fine.6 month long brain fart? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
TalivanIBM Posted September 20, 2008 Author Share Posted September 20, 2008 6 month long brain fart?I was occupied with other scripts.......... Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now