AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Beta version pre-v1.0.48: Up to 3x faster performance
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9
 
Reply to topic    AutoHotkey Community Forum Index -> Announcements
View previous topic :: View next topic  
Author Message
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Thu Feb 26, 2009 2:48 am    Post subject: Reply with quote

I ran the script with no joystick connected, and with one of the following: an old MS SideWinder Precision Pro, a no-name gamepad ($9.95) and with a UHID joystick controller. The script crashed after: No joystick: 45 min, MS SideWinder: 30 minutes, Gamepad: 5 minutes, UHID: 2 minutes. The errors were something like these:

Unhandled exception at 0x0040ea0a in AutoHotkey.exe: 0xC0000005: Access violation reading location 0x00000018.

Unhandled exception at 0x0040ea8a in AutoHotkey.exe: 0xC0000005: Access violation reading location 0x00000030.

Only this combination of functions looks deadly (Multimedia timer and AHK-timer with joystick calls). If I replace the multimedia timer with another AHK-timer or with DllCall("winmm.dll\joySetCapture", Uint, HostID, Uint,Joy#, Uint,Period, Uint,0), there is no crash. Unfortunately, neither is satisfactory for a music controller script: the AHK-timer is inaccurate for music, joySetCapture stops and cannot be restarted if the joystick gets un/re-plugged.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Thu Feb 26, 2009 8:11 pm    Post subject: Reply with quote

I've been running the script in the compiler's debug mode. So far it has been running over 3 hours.

Although it hasn't crashed, that could be explained by some difference between Windows XP and Vista, or some other difference in systems.

Although the VM Size (private set) hasn't increased from its original 2652, the "mem usage" has increased by 56 KB, apparently due to shared and shareable working set increasing, but also in an unexplained rise in "private image size" from 340 to 344. Neither heap nor stack memory has increased in size.

Unfortunately VMMap doesn't show the source of the memory increase. All it reveals is that the memory area at 0x2A0000 has increased from 28 to 56 KB. I looked at the memory there, but unfortunately there is no readable text -- and so no obvious clues about its nature.

I'll keep running it in the hopes that the debugger will reveal the location of any exception that occurs.
Back to top
View user's profile Send private message Send e-mail
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Thu Feb 26, 2009 8:33 pm    Post subject: Reply with quote

Update: MSDN tells that the multimedia timer is obsolete. However, with the recommended replacement (CreateTimerQueueTimer) the memory footprint still grows and the script crashes even faster. It is in Vista-32 SP1, AHK Version 1.0.48.00. (Reducing the Timer function to a single i++ makes no difference.)

In my old laptop (XP SP3, AHK 1.0.47.05) the memory also steadily but very slowly increases (from 2504KB to over 4MB). The script did not crash overnight.

Contrary to my earlier note, a similar script (below) crashed (in Vista) even with the standard AHK timer. The memory shown by the Task Manager grew (2504KB --> ~2812KB), when the script slowed down (the tooltip update almost halted); some furious disk activity occured; and the script crashed in a minute.

The second time I ran the script it recovered from this slow down: it sped up again and the memory increase stopped. Of course, this slowdown renders the script useless, but this recovery is remarkable.

After a crash, the next time the script remains alive noticeably longer. Maybe Windows made room for some resources, and it takes longer to exhaust it.
Code:
CoordMode ToolTip, Screen
VarSetCapacity(JOYINFO,16,0)
DllCall("LoadLibrary", Str,"winmm.dll")
joyGetPos := DllCall("GetProcAddress", UInt,DllCall("GetModuleHandle",Str,"winmm"), Str,"joyGetPos")
SetTimer Sometimes, 33
SetTimer Ipp, 1

!z::ExitApp

Ipp:
   iTimer++
Return

Sometimes:
   JoyTemp =
   Loop 16
      JoyTemp .= DllCall(joyGetPos, Uint,A_Index-1, Uint,&JOYINFO) = 0
   tooltip (%iTimer%/%A_Now%) %JoyTemp%, 0,0,20
Return
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Thu Feb 26, 2009 9:00 pm    Post subject: Reply with quote

Thanks for the info.

If I should switch over to the new script, let me know. Otherwise I'll keep the other one running a while, perhaps 24 hours or so.
Back to top
View user's profile Send private message Send e-mail
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Fri Feb 27, 2009 4:16 am    Post subject: Reply with quote

After trying hundreds of variants I realized that the problem is in WinMM\joyGetPos, not in AHK. If I replace joyGetPos with joyGetPosEX, there is no memory leak (although no notification on joystick availability, either). The solution is simple: Call joyGetPos only when necessary (on message WM_DEVICECHANGE), not in a timer or in a loop. Although the memory footprint still increases at un/plugging joysticks, it is not enough to crash the script.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Fri Feb 27, 2009 1:39 pm    Post subject: Reply with quote

Although it's a relief that there's no bug in AutoHotkey in this case, I think its good that cases like this be fully investigated (as you did) to ensure that the program operates reliably at a low level.

Thanks for the follow-up.
Back to top
View user's profile Send private message Send e-mail
Guest






PostPosted: Thu Mar 19, 2009 5:36 am    Post subject: Application Error Reply with quote

Reporting queued error: faulting application explorer.exe, version 6.0.3790.3959, faulting module ntdll.dll, version 5.2.3790.3959, fault address 0x0004afb2.

Hi Guys installed the AHK version on Server 2003 and it caused the above error every time I restarted the computer.

Uninstalled and no longer have the error, no idea why I just uninstalled programs installed at the time till it stopped happening.
Back to top
Guest






PostPosted: Thu Mar 19, 2009 5:39 am    Post subject: Re: Application Error Reply with quote

Anonymous wrote:
...I just uninstalled programs installed at the time till it stopped happening.

...ok re-install AHK & make sure it comes back?
Back to top
Guest






PostPosted: Fri Mar 20, 2009 2:02 am    Post subject: Reply with quote

Reporting queued error: faulting application explorer.exe, version 6.0.3790.3959, faulting module ntdll.dll, version 5.2.3790.3959, fault address 0x0004afb2.


Hi Guys re-installed the current AHK version on Server 2003 and it was ok, then installed the beta and the error came back. My biggest issue after reading about the above error is that it has so many different cause's possible. Eg conflict between two programs, Ram fault, DEP error

From all I read you could have two machines that are almost identical and one could error and the other won't.

** Removed the Beta and put it back to current version error didn't occur.

The installed programs in-case it is a conflict

ATI Display Driver
eSignal (Charting package)
Intel Pro Network Conn Drivers
Logmein
MS .NET 2.0 sp2
MS .NET 3.0 sp2
MS .NET 3.5 sp1
MSXML 6 sp 2
IE 7
win search 4.0
win server 2003 sp2


Hardware
(Dell 1425sc)
Intel Xeon 2.8
2GB Ram

If you need any other information let me know,

Tim
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Announcements All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9
Page 9 of 9

 
Jump to:  
You cannot post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group