AutoHotkey Community

It is currently May 27th, 2012, 6:56 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: memory leak
PostPosted: October 5th, 2011, 10:51 am 
Offline

Joined: May 5th, 2008, 12:29 am
Posts: 6
Location: Roma, Italy
Hello and thanks again for this life saver! by searching i finally found the way to make a small donation.

I'm using AHK v1.1.04.01 (32bit) on W7 64bit.

this basic script
Code:
#Persistent
setTimer, test, 300

test:
    if winExist("Reaper")
        return
    return


is continuously taking more memory.
After few days i have to reload the script because it is taking 350+MB of memory.

The script i'm actually using is longer but i found that even this simple one reproduces the bug.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 5th, 2011, 10:42 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
I believe this is an unfortunate side effect of certain Win32 APIs, not a bug in AutoHotkey. See the following thread:
possible leak in winwait, win 7 x64 --- AHK 1.0.48.05

However, during my testing, the memory usage only increased so much before I ran out of "new applications" to launch and it stopped increasing. My everyday scripts use these functions and occasionally run for weeks on end, yet I've never seen them use more than 25MB (Working Set) each.

It's my understanding that Working Set includes memory shared with other processes whereas Private Working Set does not. Private Working Set did not increase during my testing, which indicates the process is only referencing additional shared memory, not actually allocating more memory. If the script is using 350MB of memory and you reload it, does your available system memory increase by around 350MB?

For instance, my three everyday scripts were using a total of 45.4MB Working Set before reloading, and 27.7MB after reloading. That's apparently 17.7MB which has been freed, but my available memory only increased by 2MB.

Does this simple test script eventually consume 350MB, or has that so far only happened with your actual script? There's always the possibility that something else in your script is also leaking memory.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher and 3 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group