[GE users] JGDI Memory leak ??

Andre Alefeld Andre.Alefeld at Sun.COM
Thu May 8 13:09:00 BST 2008


Hi Sinong,

I'll take a look at it. Which Grid Engine version were you using for  
your development ? It seems to be 6.1 is this correct ? But be aware  
that JGDI is not a stable interface and currently intended for  
internal development. So changes might happen without warning.

Andre

On May 8, 2008, at 10:55 AM, Sinong Fan wrote:

> Hi All
>
> I'm asking for help about JGDI library. I'm using JGDI to monitor  
> the jobs in grid engine, however I find the programme eats more and  
> more memory until killed by the kernel at last. I checked java heap  
> with no problem so I guess there's some memory leak when calling JNI  
> functions.
>
> I wrote a very simple test programme and the memory usage grows from  
> 17m - 200m overnight. Can anyone help? Many thanks!
>
> package jgditest;
>
> import java.io.*;
> import java.util.*;
>
> import com.sun.grid.jgdi.*;
> import com.sun.grid.jgdi.monitoring.*;
> import com.sun.grid.jgdi.configuration.Job;
>
> /**
>  * <p>Title: </p>
>  *
>  * <p>Description: </p>
>  *
>  * <p>Copyright: Copyright (c) 2007</p>
>  *
>  * <p>Company: </p>
>  *
>  * @author not attributable
>  * @version 1.0
>  */
> public class JGDITest
>     implements com.sun.grid.jgdi.event.EventListener {
>
>   protected JGDI jgdi;
>
>   public JGDITest() {
>
>     try {
>
>       //initialize JGDI Client
>       jgdi = JGDIFactory.newInstance("bootstrap:///usr/local/extra/ 
> grid/n1ge at emea:6444");
>       EventClient ec = JGDIFactory.createEventClient("bootstrap:/// 
> usr/local/extra/grid/n1ge at emea:6444", 0);
>
>       ec.addEventListener(this);
>       ec.subscribeAddJob(true);
>       ec.start();
>       ec.commit();
>
>     }
>     catch (JGDIException e) {
>       e.printStackTrace();
>     }
>     catch (IOException e) {
>       e.printStackTrace();
>     }
>     catch (InterruptedException ex) {
>       ex.printStackTrace();
>     }
>     catch (Exception e) {
>       e.printStackTrace();
>     }
>
>
>
>   }
>
>   //query the Grid Engine
>   public void updateQueueView() {
>
>     QueueInstanceSummaryOptions options = new  
> QueueInstanceSummaryOptions();
>     options.setShowFullOutput(true);
>
>     if (jgdi != null) {
>         try {
>
>             QueueInstanceSummaryResult result =  
> jgdi.getQueueInstanceSummary(options);
>
>             if (result != null) {
>                 List<QueueInstanceSummary> queueInstanceList =  
> result.getQueueInstanceSummary();
>                 List<JobSummary> jobPendingList =  
> result.getPendingJobs();
>
>                 for (QueueInstanceSummary qis : queueInstanceList) {
>                     List<JobSummary> jobRunningList =  
> qis.getJobList();
>                     for (JobSummary js : jobRunningList) {
>
>                         System.out.println(js.getName());
>                         System.out.println(new  
> Integer(js.getId()).toString());
>                         System.out.println(js.getUser());
>                         System.out.println(js.getStartTime());
>                         System.out.println(js.getState());
>                         System.out.println(js.getQueue());
>                         System.out.println(new  
> Integer(js.getSlots()).toString());
>
>                     }
>                 }
>
>                 for (JobSummary js : jobPendingList) {
>
>                     System.out.println(js.getName());
>                     System.out.println(new  
> Integer(js.getId()).toString());
>                     System.out.println(js.getUser());
>                     System.out.println(js.getSubmitTime());
>                     System.out.println(js.getState());
>                     System.out.println(js.getQueue());
>                     System.out.println(new  
> Integer(js.getSlots()).toString());
>                 }
>
>             }
>
>       }
>       catch (Exception ex) {
>         ex.printStackTrace();
>       }
>     }
>
>   }
>
>   public void eventOccured(com.sun.grid.jgdi.event.Event event) {
>      updateQueueView();
>   }
>
>   public static void main(String[] argv) {
>     new JGDITest();
>   }
>
> }
>
>
> Yours sincerely,
>
>
> Sinong Fan
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe at gridengine.sunsource.net
For additional commands, e-mail: users-help at gridengine.sunsource.net




More information about the gridengine-users mailing list