Carlo84 Posted April 15, 2011 Posted April 15, 2011 From: http://www.autoitscript.com/autoit3/docs/intro/ComRef.htm When you assign an Object variable a different value, the 'pointer' will automatically be released. You can, for instance, force deletion of an Object by assigning it any number or any text value.$oHTTP = ObjCreate("winhttp.winhttprequest.5.1") ; Object is created $oHTTP = 0 ; Object is deletedBut when i use ObjCreate in my script (in this case "ImageMagickObject.MagickImage.1") the memory usage of my script goes up (1k) but it wont go down after releasing the object. is there anyway to get completely rid of this? PS: creating the object again after "releasing" it does not cause memory usage to go up again _SplashProgressImage | _Regionselector | _IsPressed360 | _UserAccountContol_SetLevel | _ListSubFolders
PsaltyDS Posted April 16, 2011 Posted April 16, 2011 There is a DLL call to release working memory from the process, but it isn't worth worrying about. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Carlo84 Posted April 16, 2011 Author Posted April 16, 2011 There are running multiple instances of my exe doing diffrent things, the diffrence of memory per instance all toghetter makes it worth it as it makes up for a huge diffrence, especially since they are idle most of the time, and run allong a program that requires a high amount of CPU and memory recourses. _SplashProgressImage | _Regionselector | _IsPressed360 | _UserAccountContol_SetLevel | _ListSubFolders
Carlo84 Posted April 16, 2011 Author Posted April 16, 2011 (edited) Thanks for the pointer, i think something in here will proof usefull :-) [Edit:] The solution i used: Func _ObjRelease(ByRef $Object) $Object = 0 Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', @AutoItPID) Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0]) DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0]) Return $ai_Return[0] EndFunc ;==>_ObjRelease thanks to this post Edited April 16, 2011 by Djarlo _SplashProgressImage | _Regionselector | _IsPressed360 | _UserAccountContol_SetLevel | _ListSubFolders
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