Re: [eclipse-users] Java exception is being thrown when invoking an eclipse program scheduling over 300 tasks

From: Kish Shen <kisshen_at_...5...>
Date: Wed, 12 Dec 2007 14:23:01 +0000
William Heath wrote:
> Hi Kish,
>
> I figured it out and it is definitely a memory issue with eclipse-clp.
>  What I did to solve it was this:
>
>   java.lang.System.setProperty("eclipse.global-size", "1024");
>   java.lang.System.setProperty("eclipse.local-size", "1024");
>
> This increases eclipse's memory consumption.  Ok now I have a harder
> question to ask, my program is scheduling tasks but it is taking a
> reaaallllyyyy long time.  Can someone help me to please speed up my
> eclipse-clp prolog program?
>
> You can see the source at:
>
> http://adempiere.svn.sourceforge.net/viewvc/adempiere/branches/libero/extend/src/test/functional/fcsched_test.pl?view=markup
>
> Any suggestions would be very, very, very welcome.  Keep in mind that
> this is for an opensource project and all will benefit.
>
> -Tim
>
> P.S.
>
> I think the main issue is when I convert from an IC_SET to an IC_DOM as follows:
>
> convertIC_SET_to_IC_DOM(Ic_set, Ic_dom):-
>    	    writeln('convertIC_SET_to_IC_DOM'),
>               ic_sets:(Ic_domVar in Ic_set),
>               ic:(get_domain_as_list(Ic_domVar,Ic_setIntegerList)),
>               ic:(Ic_dom::Ic_setIntegerList).
>
>
> createIC_SET(ResourceAvailableTime,1,100000).  Because I intersect
> tasks with my ResourceAvailableTime I must switch back and forth
> between and IC_SET and an IC_DOM.  This takes a very large amount of
> time when I want to schedule in minutes for 2 years, that could be
> 1000000 minutes.  Can anyone recommend a better or faster way for me
> to do this?
>
> -Tim
>   
Hi,

It is a bad idea to use such large domains in ic, and in particular, to 
convert it to a list. Finite domains are represented as a bitmap, one 
bit for each element, and a bitmap for 1 million elements takes up more 
than 130K of memory, and this is the domain for a single variable.

Conerting a domain with a million elements to a list will result in a 
list with a length of about a million (assuming most of the domains are 
available). Each list element takes up about 4 words (16 bytes on a 32 
bit machine) of space, so a million element list is about 16M in size. 
Again, this is for a single domain.

Creating such strutctures and using them will indeed take a long time. 
It seems highly unlikely to me that your taks, which you need to 
schedule in minutes, will last anything like as long as 2 years. I would 
suggest breaking up your scheduling period into shorter interals or 
schedule wih a smaller time resolution (or maybe a combination of both, 
do a less precise scheduling for the whole 2 years, and then more 
precisely for a much shorter interval.

Cheers,

Kish
Received on Wed Dec 12 2007 - 14:23:14 CET

This archive was generated by hypermail 2.2.0 : Mon Jul 09 2018 - 02:05:29 CEST