⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (363 Bytes)
Bug #15423
ยป fork_leapfrog_freebsd.rb
normalperson (Eric Wong)
, 12/16/2018 02:28 PM
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
(1-1/1)
Loading...