Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Help me with memory leak please

$
0
0
Hi everyone, I have a problem while reading memory, everything goes fine reading values from memory here. But after about 1 or 2 hours, my swap/RAM go up to full and my computer just get hang, everything is freezed, I have to reset my computer.


Could you please read the code and tell me why I have memory leak? As you can see there I have _MemoryClose, even clear the label for reduce memory, and even empty working set of all program, but the result is: the "xxx.exe" only take up about 50-100MB, that's normal, but the RAM usage and SWAP file keep getting bigger till computer freezed, why is that?


P/s: I've spent over 2 days on this forum finding posts about memory leak, all I can get is empty working set, but it's no use, i still can not figure out why  I have this memory leak, so please help me if you can :sweating:


here the code:
[ autoit ]         
Global $abc_addr Global $abc $abc_addr = 0x00112233 ;just an example Func read_abc() $openmem = _MemoryOpen(ProcessExists("xxx.exe")) $abc = _MemoryRead($abc_addr, $openmem) _MemoryClose($openmem) GUICtrlSetData($abc_show, "") ;label GUICtrlSetData($abc_show, $hp) ;label Sleep(300) EndFunc ;==>read_abc Func get() Sleep(200)          read_abc()          If $abc < 1000 Then                  ;do shit          EndIf      reducememory() ;this one will empty working set of some programs, xxx.exe for details EndFunc ;==> get While 1          get() WEnd

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>