On 2011-11-29 Jonathan Nieder wrote: > Lasse Collin wrote: > > > With compression, -T0 in 5.1.1alpha sets the number of threads to > > match the number of CPU cores. If no memory usage limit has been > > set, it may end up using more memory than there is RAM. Pushing the > > system to swap with threading is silly, because the point of > > threading in xz is to make it faster. So it might make sense to > > have some kind of default soft limit that is used to limit the > > number of threads when automatic number of threads is requested. > > How about something like this patch, to start? With it applied, I am > happy using > > XZ_DEFAULTS='--no-adjust --threads=0 --memlimit=1080MiB
After the patch, --no-adjust doesn't prevent auto-adjusting the number of threads. It would only prevent auto-adjustments of LZMA2 dictionary size. I'm not sure if I like this or not. I guess that your idea is to use --no-adjust to catch situations where the specified settings are too high even for single-threaded operation, and use more than one thread when the memory limit allows. I don't know if someone would want to use --no-adjust to prevent xz from scaling down the number of threads. Maybe your use case is more likely. -- Lasse Collin | IRC: Larhzu @ IRCnet & Freenode
