⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (440 Bytes)
Misc #19052
» thread_test.rb
bosh-ecosystem-vmware (BOSH Ecosystem Team @ VMware)
, 10/14/2022 12:15 AM
def
print_memory
puts
"statm resident Memory:
#{
Hash
[
%i{size resident shared trs lrs drs dt}
.
zip
(
open
(
"/proc/
#{
Process
.
pid
}
/statm"
).
read
.
split
)][
:resident
].
to_i
*
4
}
"
puts
open
(
"/proc/
#{
Process
.
pid
}
/smaps_rollup"
).
read
puts
"--------------------------------------"
end
puts
"Before thread"
print_memory
threads
=
[]
10
.
times
do
|
i
|
threads
<<
Thread
.
new
do
end
end
threads
.
each
(
&
:join
)
puts
"After thread ended"
print_memory
« Previous
1
2
Next »
(2-2/2)
Loading...