[p4] p4com and long-running tasks

Andreas Axelsson Andreas.Axelsson at dice.se
Thu Oct 6 02:04:19 PDT 2005


I was too hasty. I had lowered the call frequency and after running for
20 hours I got an out of memory error and my app crashed. I tried then
to raise the frequency to once a second, running against a test p4
server and I noticed that memory usage was bumped by some 4k per update,
each update calling p4com a number of times. I then replaced the calls
to p4com with a mock, returning only predefined (but valid) output and
the memory usage stabilized. Could it be a leak in p4com, or the p4api?
Or is it the C#/.NET interop communication that messes things up?

/axl

> -----Original Message-----
> From: perforce-user-bounces at perforce.com 
> [mailto:perforce-user-bounces at perforce.com] On Behalf Of 
> Andreas Axelsson
> Sent: den 5 oktober 2005 08:08
> To: Robert Cowham
> Cc: perforce-user at perforce.com
> Subject: RE: [p4] p4com and long-running tasks
> 
> 
> It looks like recreating the p4com::p4 object whenever 
> there's a failure solved the problem, or at least it hasn't 
> failed in quite a while now.
> I'll report back with further findings.
> 
> Thanks
> /axl
> 
> > -----Original Message-----
> > From: Robert Cowham [mailto:robert at vaccaperna.co.uk]
> > Sent: den 3 oktober 2005 10:59
> > To: Andreas Axelsson
> > Cc: perforce-user at perforce.com
> > Subject: RE: [p4] p4com and long-running tasks
> > 
> > See below.
> > 
> > > I first assumed it was failing because the perforce server
> > was being
> > > offline running backups at night, but that doesn't seem to be the 
> > > case.
> > > Running against non-existing servers, or a local service
> > that's turned
> > > off produces another error message. Checking the server
> > logs indicates
> > > that backup is running on-line and not on the times that the tool 
> > > fails.
> > > 
> > > Some details:
> > > The tool uses p4com to regularly query for changes on 
> certain files.
> > > Sometimes, usually during the night, it fails with:
> > > The server threw an exception. (Exception from HRESULT: 0x80010105
> > > (RPC_E_SERVERFAULT)) at P4COM.p4Class.run(String cmd)
> > > 
> > > The odd thing is that it never recovers after that error. 
> > No matter if
> > > the server is available or not. It continues to report the
> > same error
> > > until the tool is restarted.
> > 
> > There is some tracing you can turn on to see what is 
> happening within 
> > p4com:
> > 
> > Set following key to 1
> > HKEY_CURRENT_USER\Software\Perforce\P4OFC, DebugTrace
> > 
> > And download dbgview from sysinternals.com website and run 
> it on your 
> > machine. See what happens.
> > 
> > Also, if you are querying from time to time, then you might want to 
> > create a new p4com::p4 class instance for every query to 
> see if that 
> > makes a difference.
> > 
> > > If I run against a local server, which is turned on and
> > off, I get the
> > > following error:
> > > (0x80020009): Connect to server failed; check $P4PORT. TCP
> > connect to
> > > aax-1:1666 failed. connect: aax-1:1666: WSAECONNREFUSED 
> Turning the 
> > > server on again restores the functionality.
> > 
> > Well this is by design unless I am misunderstanding 
> something here?! 
> > You would get the same error message from the command line or p4win 
> > etc.
> > 
> > > Btw, I tried creating new instances of the p4com::p4 class
> > whenever a
> > > failure showed up. So far it has resulted in a silent
> > shutdown of the
> > > tool. Further investigation pending...
> > 
> > It would be useful to know what's going on in this case.
> > 
> > Robert
> > 
> > 
> > 
> 
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com 
> http://maillist.perforce.com/mailman/listinfo/perforce-user
> 
> 




More information about the perforce-user mailing list