one try and I am done

Post any questions, ideas, or topics related to Jython and Python scripting.
Post Reply
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

one try and I am done

Post by joleenf »

Hi,

I have a jython script which loops to find data clusters. Currently, I am performing some testing from the jython shell and it works fairly quickly for an area of 1840x2240, depending on how many pixels have a mask value of 1. However, I can only run once. If I try to run again or on another area, McIDAS-V stops responding. It does not appear that the memory at max: 862/1479/6537, but my session is locked. I think this is probably the jython loop causing this, but I don't know. I have posted the code and areas at /pub/incoming:

/pub/incoming/SH-*Band2_Unit_Pos[0-5].area
/pub/incoming/clusterDataMask.jar

generally, I have been running on the 5:45 data and masking values less than 160 and greater than 340.
a=selectData()
clusterDataMask(a[0],160,340,1,1)

Joleen
User avatar
Rick
Posts: 404
Joined: Fri Jan 16, 2009 8:20 pm

Re: one try and I am done

Post by Rick »

Hi Joleen,

Sorry for the delay getting to your forum post, I did not grab the files and they have been deleted. Please repost the files.

Thanks,

Rick
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: one try and I am done

Post by joleenf »

Hi Rick,

Tom looked at these and determined it was the createDisplay('imagedisplay',data) calls that were causing the problem. I am looking at alternatives now.

Joleen
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: one try and I am done

Post by joleenf »

If I am running some code from the jython shell that creates a number of data objects to analyze a case study. I wish to use this code on multiple cases. Would it help to clear the output buffer or restart the jython shell to help address excessive memory usage?

Joleen
User avatar
beckys
Posts: 172
Joined: Wed Jan 07, 2009 7:50 pm

Re: one try and I am done

Post by beckys »

Hi Joleen,

From our testing, we believe that this is a threading issue. Jon is making changes to run createLayer on the event dispatch thread, which fixes the problem for us. I don't think he's checked that in yet, but I'll talk to him today and find out the status.

- Becky
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: one try and I am done

Post by joleenf »

Hi Becky,

I think I have strayed onto two different issues and probably should have started a new post. I am working with a student who is doing some data analysis in McIDAS-V. The code itself creates a number of flatFields along with displaying them. I understand that collectGarbage() does not consistently free memory and was wondering if there was anything else that could be attempted to free the memory before he starts a new case. He would not need of the old arrays for the next run. I was thinking that clearing the output buffer my free up memory used for the extra arrays and give him a cleaner start for the next run, but I don't know enough about this.

Joleen
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: one try and I am done

Post by joleenf »

Jon,

Is the system.gc() different than collectGarbage()?

Joleen
User avatar
Jon
Posts: 192
Joined: Fri Jan 09, 2009 8:44 pm
Location: Madison, WI

Re: one try and I am done

Post by Jon »

joleenf wrote:Jon,

Is the system.gc() different than collectGarbage()?

Joleen


D'oh! Thanks for asking, because they're currently the same thing. collectGarbage() is just a more informative name for System.gc().
User avatar
mug_admin
Site Admin
Posts: 87
Joined: Thu Dec 18, 2008 9:31 pm

Re: one try and I am done

Post by mug_admin »

Jon added code to createLayer to now run on the Event Dispatch Thread. The change will be in the next nightly build. He's also working on something to reset the session, so that objects that are no longer needed will be eligible for garbage collection.
User avatar
joleenf
Posts: 1123
Joined: Mon Jan 19, 2009 7:16 pm

Re: one try and I am done

Post by joleenf »

Thanks for the info!

Joleen
Post Reply