Project

General

Profile

Actions

Bug #15422

closed

Re: [ruby-cvs:73514] normal:r66413 (trunk): thread_pthread.c: fix memory leak from fork loop leapfrog (v3)

Added by normalperson (Eric Wong) almost 6 years ago. Updated about 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:90566]

Description

https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66413

Finally fixed for GNU/Linux. Not on FreeBSD 11.2,
but it was also present in 2.4.5:

==> fork_leapfrog_freebsd.rb <==
require 'io/wait'
prev = 0
100000.times do
pid = fork
exit!(0) if pid

show the RSS (FreeBSD 11.x)

n = IO.popen("ps -u #$$", &:readlines)[1].split[5].to_i
if n > prev
puts "#{prev} => #{n}"
prev = n
end

since Ctrl-C from a terminal can't stop this loop,

allow the user to just mash the keyboard to stop

break if STDIN.wait(0)
end


Related issues 1 (1 open0 closed)

Related to Ruby master - Bug #15423: fork leapfrog leaks memory on FreeBSD 11.2OpenActions
Actions

Also available in: Atom PDF

Like0
Like0Like0