Skip Menu |
 

This queue is for tickets about the Mac-Glue CPAN distribution.

Report information
The Basics
Id: 25832
Status: open
Priority: 0/
Queue: Mac-Glue

People
Owner: Nobody in particular
Requestors: jelte [...] liebrand.co.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Mac::Glue eating up all the memory?
Date: Mon, 26 Mar 2007 22:43:04 +0100
To: Chris_Nandor via RT <bug-Mac-Glue [...] rt.cpan.org>
From: Jelte Liebrand <jelte [...] liebrand.co.uk>
Download (untitled) / with headers
text/plain 1.3k
HI there, Remember me? We emailed a while ago about some script i was putting together using Mac::Glue, and more specifically Mac::EyeTV. Basically everything has been working fine, but recently my script (which runs nightly) got itself in a mess. Basically this bit of code: #!/usr/bin/perl -w use strict; use Mac::EyeTV; use Mac::Glue; use Mac::AppleEvents::Simple 1.18; my $eyetv = Mac::EyeTV->new(); my @eyeTvChannelList = $eyetv->channels; will just gobble up about 1 GB of memory before running completely out of memory. It does so on the last line (getting the channels). Now this used to work fine, so perhaps EyeTV has got some internal bits wrong or something, but inside EyeTV everything is fine. Still the same number of channels and all is well. Btw, there are only about 88 channels or so (most of which are disabled). I reinstalled eyetv completely and then things worked again. But then a few weeks later, bam: same story... I tried to debug through the glue code, but as the comment says: "here be demons", no sh*t... that stuff is a little too hardcore for me to workout where the memory problems are occurring! :-) Would you have any idea where I should look to work out what is going on? Any help would be appreciated, since I obviously dont want to re- install EyeTV every couple of weeks... /Cheers, Jelte
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #25832] Mac::Glue eating up all the memory?
Date: Mon, 26 Mar 2007 20:03:40 -0700
To: bug-Mac-Glue [...] rt.cpan.org
From: Chris Nandor <cnandor [...] cpan.org>
Download (untitled) / with headers
text/plain 651b
I wonder if maybe there's a recursive loop in Mac::EyeTV or something? Is this Mac::EyeTV 0.30? I see no problem there. Did you try the same code, but in AppleScript? That might show if the problem is in EyeTV. You can see the actual Apple events using the aedebug script: http://dev.macperl.org/files/scripts/aedebug % aedebug perl testscript.plx You can use that with AppleScript too: % aedebug osascript testscript.scpt Compare the results etc. Hope that helps as a starting point ... -- Chris Nandor pudge@pobox.com http://pudge.net/ Open Source Technology Group pudge@ostg.com http://ostg.com/
Subject: Re: [rt.cpan.org #25832] Mac::Glue eating up all the memory?
Date: Fri, 6 Apr 2007 16:03:57 +0100
To: bug-Mac-Glue [...] rt.cpan.org
From: Jelte Liebrand <jelte [...] liebrand.co.uk>
Download (untitled) / with headers
text/plain 2.2k
Hiya, Ok, it's taken a bit, but I think I've gotten a little bit further on this memory problem. First of all some things I found: 1- If I just run my script on itself, things work fine 2- If I run it a gazillion times, it still works fine 3- If I run it as a daily cron job, then it the first day it works fine, but the second day (and subsequent days it seems) it gets itself in to this memory hogging problem 4- Once it's in this odd state I can run my example script (the one I mailed you before, where it merely gets an array of channels from EyeTV) and that will show the problem: perl will start to hogg about 1GB of memory 5- If I close EyeTV and then run that script, perl still hogs that memory without EyeTV even being started... ie it hasn't even gotten to the point of doing any real applescript towards EyeTV yet. 6- if I run applescript to do the same task, that works, but the perl script still fails. So.... I'm thinking that the Mac::Glue might be allocating some object or something, and that because the script is run from cron, that memory doesn't get released / reset. Thus the next day that you run the script, some values in that object are still set. Making it go all hay wire. I know this is all a pretty high level problem description, but can you think of anything that would make things go all wrong if you were to run perl scipts that use Mac::Glue from a cron task? /Cheers, Jelte Ps. Happy Easter! On 27 Mar 2007, at 04:11, Chris_Nandor via RT wrote: Show quoted text
> > <URL: http://rt.cpan.org/Ticket/Display.html?id=25832 > > > I wonder if maybe there's a recursive loop in Mac::EyeTV or > something? Is > this Mac::EyeTV 0.30? I see no problem there. > > Did you try the same code, but in AppleScript? That might show if the > problem is in EyeTV. > > You can see the actual Apple events using the aedebug script: > > http://dev.macperl.org/files/scripts/aedebug > > % aedebug perl testscript.plx > > You can use that with AppleScript too: > > % aedebug osascript testscript.scpt > > Compare the results etc. Hope that helps as a starting point ... > > -- > Chris Nandor pudge@pobox.com http://pudge.net/ > Open Source Technology Group pudge@ostg.com http://ostg.com/ >
Subject: Re: [rt.cpan.org #25832] Mac::Glue eating up all the memory?
Date: Fri, 6 Apr 2007 16:52:26 +0100
To: Chris_Nandor via RT <bug-Mac-Glue [...] rt.cpan.org>
From: Jelte Liebrand <jelte [...] liebrand.co.uk>
After a little more investigation, and venturing in to the perl debugger, I've found the eternal loop it seems to get itself in. But it doesn't really tell me much. In /Library/Perl/5.8.6/darwin-thread-multi-2level/Mac/Processes.pm line 207: sub NEXTKEY { my($self,$psn) = @_; Mac::Processes::GetNextProcess($psn); } Not quite sure it is actually in a loop, but the $psn is 2695102466, trying to execute the GetNextProcess seems to just hang / gobble up memory. Ctrl-c in the debugger stops it, but stepping on puts it in the same place again.... Could it be that the Mac::Glue is trying to find the process EyeTV and it fails somehow? This is all still as a resuly of my @bla = $eyeTV->channels; /J On 6 Apr 2007, at 16:03, Jelte Liebrand wrote: Show quoted text
> Hiya, > > Ok, it's taken a bit, but I think I've gotten a little bit further > on this memory problem. First of all some things I found: > > 1- If I just run my script on itself, things work fine > 2- If I run it a gazillion times, it still works fine > 3- If I run it as a daily cron job, then it the first day it works > fine, but the second day (and subsequent days it seems) it gets > itself in to this memory hogging problem > 4- Once it's in this odd state I can run my example script (the one > I mailed you before, where it merely gets an array of channels from > EyeTV) and that will show the problem: perl will start to hogg > about 1GB of memory > 5- If I close EyeTV and then run that script, perl still hogs that > memory without EyeTV even being started... ie it hasn't even gotten > to the point of doing any real applescript towards EyeTV yet. > 6- if I run applescript to do the same task, that works, but the > perl script still fails. > > So.... I'm thinking that the Mac::Glue might be allocating some > object or something, and that because the script is run from cron, > that memory doesn't get released / reset. Thus the next day that > you run the script, some values in that object are still set. > Making it go all hay wire. > > I know this is all a pretty high level problem description, but can > you think of anything that would make things go all wrong if you > were to run perl scipts that use Mac::Glue from a cron task? > > /Cheers, > Jelte > Ps. Happy Easter! > > > > On 27 Mar 2007, at 04:11, Chris_Nandor via RT wrote: >
>> >> <URL: http://rt.cpan.org/Ticket/Display.html?id=25832 > >> >> I wonder if maybe there's a recursive loop in Mac::EyeTV or >> something? Is >> this Mac::EyeTV 0.30? I see no problem there. >> >> Did you try the same code, but in AppleScript? That might show if >> the >> problem is in EyeTV. >> >> You can see the actual Apple events using the aedebug script: >> >> http://dev.macperl.org/files/scripts/aedebug >> >> % aedebug perl testscript.plx >> >> You can use that with AppleScript too: >> >> % aedebug osascript testscript.scpt >> >> Compare the results etc. Hope that helps as a starting point ... >> >> -- >> Chris Nandor pudge@pobox.com http:// >> pudge.net/ >> Open Source Technology Group pudge@ostg.com http:// >> ostg.com/ >>
>


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.