[torquedev] Leaking Memory ?

Garrick Staples garrick at usc.edu
Fri Nov 6 09:11:28 MST 2009


On Fri, Nov 06, 2009 at 11:22:54AM -0200, ifeghali at petrobras.com.br alleged:
> 
> 
> Hello,
> 
> Following the same path as pbs_python
> (https://subtrac.sara.nl/oss/pbs_python), I have used SWIG
> (www.swig.org) to build a PHP wrapper for libtorque. The whole stuff
> works great for standalone applications, but iterating too many times
> (on a daemon for instance) makes the memory usage sky rocket. It does
> not happens for python, maybe because python's garbage collection
> policy I guess, but I am not sure. But it does happen with PHP and I
> still haven't found a workaround.
> 
> For instance, the following code:
> 
> <?php
> require_once 'build/openpbs.php';
> 
> while (true) {
>    $con = pbs_connect("pbsserver");
>    pbs_statjob($con, '', null, null);
>    pbs_disconnect($con);
> 
>    print number_format(memory_get_usage(),2)."\n";
>    sleep(2);
> }
> ?>

You need to call pbs_statfree() on the linked list you get back from pbs_statjob.

-- 
Garrick Staples, GNU/Linux HPCC SysAdmin
University of Southern California

Life is Good!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.supercluster.org/pipermail/torquedev/attachments/20091106/d86ad593/attachment.bin 


More information about the torquedev mailing list