some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
user23 has joined #ruby
Fernando-Basso has quit [Remote host closed the connection]
juuh42dias has quit [Remote host closed the connection]
pounce has quit [Ping timeout: 240 seconds]
pounce has joined #ruby
lena64t has joined #ruby
juuh42dias has joined #ruby
Vonter has quit [Ping timeout: 252 seconds]
some14u has joined #ruby
some14u has quit [Client Quit]
some14u has joined #ruby
lena64t has quit [Remote host closed the connection]
lena64t has joined #ruby
MarvelousWololo has joined #ruby
seydar has joined #ruby
<seydar>
anyone looked into bulk synchronous parallel (BSP) concurrency? i'm trying to understand how it looks in practice, but i'm having a hard time
Fernando-Basso has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ox1eef__>
Never heard of it.
some14u has joined #ruby
<seydar>
separate question: multiprocessing in ruby somehow uses the same amount of memory in the child process as the parent process. i guess i though COW would protect against that, but maybe i'm just a bad programmer and operating inefficiently. anyone else run into this?
passbe has quit [Quit: bye...]
passbe has joined #ruby
Pixi has joined #ruby
Vonter has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Pixi` has quit [Ping timeout: 245 seconds]
some14u has joined #ruby
some14u has quit [Client Quit]
some14u has joined #ruby
some14u has quit [Client Quit]
some14u has joined #ruby
some14u has quit [Client Quit]
user23 has quit [Ping timeout: 246 seconds]
user23_ has joined #ruby
user23_ has quit [Remote host closed the connection]
znpy has quit [Read error: Connection reset by peer]
ollysmith has quit [Quit: ZNC 1.8.2+deb3.1 - https://znc.in]
ollysmith has joined #ruby
_ht has joined #ruby
<ox1eef__>
The garbage collector is suppose to be CoW-friendly since a few years ago.
Linux_Kerio has joined #ruby
<leah2>
mooo!
Vonter has quit [Read error: Connection reset by peer]
desnudopenguino has quit [Read error: Connection reset by peer]
desnudopenguino has joined #ruby
<seydar>
i've learned that ruby doesn't return freed memory to the OS, so if I reach 500 MB, it's going to stay at 500 MB. my confusion is in why a child process would *also* take up 500 MB of RAM. i need to do some testing to find out if i'm just a bad programmer or if this is the standard operating procedure
<ox1eef__>
IIRC the growth factor allocates a bigger amount every time, more than you might actually use, so decreasing it might also decrease the memory being used.
<seydar>
ox1eef__: beautiful, thank you! that might help a lot
vinc has quit [Read error: Connection reset by peer]
<adam12>
seydar: Ruby will return _some_ memory to the system, but it's not super cut-and-dry because of page fragmentation. You could maybe try compacting before/after fork and see if it will help. Also, make sure you're able to check actual memory usage correctly. Sub processes might show RAM usage of parent but that might not be accurate.
teclator has quit [Ping timeout: 260 seconds]
caedmon has joined #ruby
<seydar>
adam12: i think my google-fu is bad because i'm not seeing how to defrag memory -- any advice on that?
caedmon has quit [Ping timeout: 264 seconds]
<ox1eef__>
AFAIK Ruby will try to hang onto any memory allocates in case it will be used in the future. Whether or not it will release seems murky.
<ox1eef__>
seydar: GC.compact
<ox1eef__>
Also keep in mind that allocations will grow expoentially, especially the higher you go, so I'd look into fine-tuning the GC as well.
<adam12>
seydar: GC.compact as ox1eef__ mentioned. Call it before forking.
<adam12>
seydar: There's also this, which does a bit of magic (I think it runs GC a bunch of times to trigger generational GC, etc). https://github.com/ko1/nakayoshi_fork
c10l6 has quit [Ping timeout: 260 seconds]
<seydar>
adam12, ox1eef__: beautiful, thanks!
konsolebox has joined #ruby
Linux_Kerio has quit [Ping timeout: 244 seconds]
some14u has joined #ruby
<seydar>
GC.compact before forking, switching to ruby 3.2.2 from 3.0.0, and adding --yjit helped a ton (the biggest was 3.0.0 -> 3.2.2)
<adam12>
Nice.
vinc has joined #ruby
<seydar>
I also think the way a child process's memory is calculated is possibly misleading: i bet it's not ACTUALLY copying 400 MB of objects for each child process, but that's what ps tells me based on how it's calculated
<seydar>
so i might've been freaking out over nothing
seydar has quit [Quit: leaving]
_ht has quit [Remote host closed the connection]
octobear has joined #ruby
Pixi` has joined #ruby
Pixi has quit [Ping timeout: 250 seconds]
<ox1eef__>
X.0.0 releases are usually a bit buggy if you go by history: 1.9.0, 2.0.0
konsolebox has quit [Ping timeout: 240 seconds]
konsolebox has joined #ruby
szkl has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]