--- main.cc~ 2017-03-16 18:44:50.000000000 +0100 +++ main.cc 2017-12-11 13:13:14.000000000 +0100 @@ -678,7 +678,16 @@ std::max( data_size, LZ_min_dictionary_size() ); if( num_workers <= 0 ) + { + if( sizeof (void *) <= 4 ) // use less than 2 GiB on 32 bit systems + { + const long long mem = + 11LL * encoder_options.dictionary_size + 3LL * data_size; + const int nmax32 = ( 0x7FFFFFFF > mem ) ? 0x7FFFFFFF / mem : 1; + if( max_workers > nmax32 ) max_workers = nmax32; + } num_workers = std::min( num_online, max_workers ); + } if( !to_stdout && program_mode != m_test && ( filenames_given || default_output_filename.size() ) )