Oh, there is another quirk too watch out and that is on my todo list: Suppose you post many, many element constraints each of which uses exactly the same integer array. Then for each element constraint posted a new array is created (not for each copied, but for each posted). What is in principle possible is to first create something that is called a SharedArray (which is not yet exposed on the modeling layer but is used inside the implementation of element) and post the element constraint with this shared array instead. Then the array will exist only once in memory.
However, this you can only see if you post several thousands of element constraints. Anyway, shared arrays will be exposed on the modeling layer in 3.2.1 which will be available shortly. Christian -- Christian Schulte, www.ict.kth.se/~cschulte/ -----Original Message----- From: users-boun...@gecode.org [mailto:users-boun...@gecode.org] On Behalf Of benoit Sent: Monday, November 02, 2009 9:54 PM To: Christian Schulte Cc: us...@gecode.org Subject: Re: [gecode-users] Memory consumption - element constraint Hello, > Hi Benoit, > > Maybe you want to tell us how large your graphs are? > The largest one encountered so far only contains 310 nodes. Each arcs is duplicated 5 times. The density is approximatively 5%. > To give you an idea, we have been playing a little bit with some word > problems (brought to us by Håkan Kjellerstrand). Here, in the small examples > we tried, the arrays have around 70,000 elements and there are plenty of > these element constraints and everything is solved in around 8 Megabytes of > main memory. I think, Håkan even successfully tried examples with ten times > as many elements. > Ok. In my case, the figures are far below. The problem must come from my implementation. I shall have a look on Håkan's page. > Or, to put it into perspective: solving these puzzles with the large element > constraints takes a small fraction of the time it takes a C++ compiler to > compile the source code containing the word lists for the element > constraints as string constants... > Ok. Thank you for your answer and more generally for the excellent work accomplished in Gecode. Regards, Benoît _______________________________________________ Gecode users mailing list us...@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users _______________________________________________ Gecode users mailing list us...@gecode.org https://www.gecode.org/mailman/listinfo/gecode-users