[ruby-core:92088] Re: [Ruby trunk Feature#15667] Introduce malloc_trim(0) in full gc cycles

From: Martin J. Dürst <duerst@...>
Date: 2019-04-01 09:53:53 UTC
List: ruby-core #92088
On 2019/04/01 18:28, Waheed Al-Barghouthi wrote:

> Anyone have an idea if setting M_TRIM_THRESHOLD for a value like 40 or 80
> bytes would actually help in this case, as I believe it should
> automatically return memory to the system. I will try using its environment
> variable and test if there are any improvement by just using that variable.

I'm not at all an expert in this area, but a value like 40 or 80 
(bytes!) sounds way, way too low. The default is something like 128*1024 
bytes, and that may be a bit high, but nobody would want a system call 
just to save 80 bytes.

Regards,   Martin.

> All in all, great job everyone.
> 
> On Mon, Apr 1, 2019 at 6:05 AM <sam.saffron@gmail.com> wrote:
> 
>> Issue #15667 has been updated by sam.saffron (Sam Saffron).
>>
>> File crash.png added
>>
>> @tessi
>>
>> My tests were with 3.6.0, I will do a side by side now that I have all the
>> infrastructure of 5 vs 3.6 and even tcmalloc.
>>
>> Nice to see that gem! Looking at my graphs I think best bang would just be
>> to spin a thread that does trimming every 10-30 minutes or something,
>> especially if you can release the GVL prior to calling it (provided this
>> thing is thread safe, which @carlos should know)
>>
>>
>> ----------------------------------------
>> Feature #15667: Introduce malloc_trim(0) in full gc cycles
>> https://bugs.ruby-lang.org/issues/15667#change-77394
>>
>> * Author: sam.saffron (Sam Saffron)
>> * Status: Open
>> * Priority: Normal
>> * Assignee:
>> * Target version:
>> ----------------------------------------
>> Per Hongli's excellent article it looks like malloc_trim can help
>> tremendously with memory bloat issues.


Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next