ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:105883] [Ruby master Feature#15667] Introduce malloc_trim(0) in full gc cycles
       [not found] <redmine.issue-15667.20190314203432.5660@ruby-lang.org>
@ 2021-11-01  7:32 ` bruno.escherl@xing.com (Bruno Escherl)
  2023-12-28 14:09 ` [ruby-core:115958] " hongli (Hongli Lai) via ruby-core
  1 sibling, 0 replies; 2+ messages in thread
From: bruno.escherl@xing.com (Bruno Escherl) @ 2021-11-01  7:32 UTC (permalink / raw
  To: ruby-core

Issue #15667 has been updated by bruno.escherl@xing.com (Bruno Escherl).


Wouldn't that be a good feature in combination with GC auto_compaction? First run the auto_compaction against memory fragmentation and then call malloc_trim to give back the memory?

----------------------------------------
Feature #15667: Introduce malloc_trim(0) in full gc cycles
https://bugs.ruby-lang.org/issues/15667#change-94424

* Author: sam.saffron (Sam Saffron)
* Status: Open
* Priority: Normal
----------------------------------------
Per Hongli's excellent article it looks like malloc_trim can help tremendously with memory bloat issues. 


https://www.joyfulbikeshedding.com/blog/2019-03-14-what-causes-ruby-memory-bloat.html#a-magic-trick-trimming


I would like to get this patch tested side-by-side at Discourse, GitHub and Shopify. If it looks good I think this is both a great candidate for 2.7 and and 2.4,2.5,2.6 backports. 


Will coordinate with Shopify and GitHub to see if we can get numbers posted here, I will run tests on a live Discourse instance over the next week and report numbers here. 

Koichi, what are your thoughts, to me this looks like an incredibly safe patch, the amount of work added to major GCs is tiny compared to the potential benefit, walking all pages is a very cheap operation.



---Files--------------------------------
ruby_gc_malloc_trim.patch (1011 Bytes)
Screenshot_2019-03-28 Grafana - Compare Discourse Perf.png (530 KB)
crash.png (85.9 KB)


-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [ruby-core:115958] [Ruby master Feature#15667] Introduce malloc_trim(0) in full gc cycles
       [not found] <redmine.issue-15667.20190314203432.5660@ruby-lang.org>
  2021-11-01  7:32 ` [ruby-core:105883] [Ruby master Feature#15667] Introduce malloc_trim(0) in full gc cycles bruno.escherl@xing.com (Bruno Escherl)
@ 2023-12-28 14:09 ` hongli (Hongli Lai) via ruby-core
  1 sibling, 0 replies; 2+ messages in thread
From: hongli (Hongli Lai) via ruby-core @ 2023-12-28 14:09 UTC (permalink / raw
  To: ruby-core; +Cc: hongli (Hongli Lai)

Issue #15667 has been updated by hongli (Hongli Lai).


It looks like this ticket can be closed. I see that Ruby 3.3 makes use of malloc_trim.

----------------------------------------
Feature #15667: Introduce malloc_trim(0) in full gc cycles
https://bugs.ruby-lang.org/issues/15667#change-105915

* Author: sam.saffron (Sam Saffron)
* Status: Open
* Priority: Normal
----------------------------------------
Per Hongli's excellent article it looks like malloc_trim can help tremendously with memory bloat issues. 


https://www.joyfulbikeshedding.com/blog/2019-03-14-what-causes-ruby-memory-bloat.html#a-magic-trick-trimming


I would like to get this patch tested side-by-side at Discourse, GitHub and Shopify. If it looks good I think this is both a great candidate for 2.7 and and 2.4,2.5,2.6 backports. 


Will coordinate with Shopify and GitHub to see if we can get numbers posted here, I will run tests on a live Discourse instance over the next week and report numbers here. 

Koichi, what are your thoughts, to me this looks like an incredibly safe patch, the amount of work added to major GCs is tiny compared to the potential benefit, walking all pages is a very cheap operation.



---Files--------------------------------
ruby_gc_malloc_trim.patch (1011 Bytes)
Screenshot_2019-03-28 Grafana - Compare Discourse Perf.png (530 KB)
crash.png (85.9 KB)


-- 
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-12-28 14:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-15667.20190314203432.5660@ruby-lang.org>
2021-11-01  7:32 ` [ruby-core:105883] [Ruby master Feature#15667] Introduce malloc_trim(0) in full gc cycles bruno.escherl@xing.com (Bruno Escherl)
2023-12-28 14:09 ` [ruby-core:115958] " hongli (Hongli Lai) via ruby-core

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).