[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [p2-dev] memory usage of SAT4J
- From: Daniel Le Berre <leberre@xxxxxxx>
- Date: Sun, 17 Feb 2013 14:49:53 +0100
- Delivered-to: email@example.com
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130109 Thunderbird/10.0.12
Le 17/02/2013 13:13, Mengxin Zhu a écrit :
> Hi Daniel and Pascal,
> I observed SAT4J library need lots of memory for resolving dependencies.
> In our case we want to install 677 root IUs, and there are totally
> 17000 IUs in multiple repositories. More than 240M memory was used in
> resolving process. Especially SAT4J library totally created more than
> 210M int instances, and held them until the calculating completed.
> Above memory usage data is obtained in VisualVM.
> Is it expected behavior to create and hold such large int array for
> calculating the dependencies? If it's unavoidable trade-off for the
> calculating, do we have a formula to estimate how much memory will be
> required when resolving dependencies in certain number of IUs?
> Thank you in advance,
> Mengxin Zhu
> p2-dev mailing list
Sat4j uses arbitrary precision arithmetic (BigInteger) to manage the
weights used to order the UIs.
We use really big weights (e.g. with 30 digits!) to make sure that those
IUs are applied whatever the consequence are (e.g. for patches).
In some cases, the information can be stored on long, to reduce memory
usage. This is available in Sat4j 2.3.3 for instance.
sat4j 2.3.3 is currently being considered for inclusion with Kepler. If
you can provide us with a test case, we could check if we could reduce
the memory footprint
using long instead of BigInteger.
Another way to reduce the memory footprint would be to cache the
BigInteger object used: the objective function reuses many time the same
Reusing the same BigInteger object each time should significantly
decrease the memory footprint too.