Hi all,
i’m trying to understand how much memory I am consuming on a single machine when allocating a shared array. i show htop
output after each step.
- launch julia
PID USER PRI NI VIRT RES S CPU% MEM% TIME+ Command
25353 florian.o 40 0 10.7G 165M ? 0.0 1.0 0:00.51 julia
- create an array of shared array on a single processor
x= [SharedArray(Float64,(100,5,8,5,2,30),pids=workers()) for i in 1:60];
# htop
PID USER PRI NI VIRT RES S CPU% MEM% TIME+ Command
25532 florian.o 26 0 11.8G 192M ? 0.0 1.2 0:02.16 julia
- in a new session, create the shared array on 4 worker processes
# new session
addprocs(4)
x= [SharedArray(Float64,(100,5,8,5,2,30),pids=workers()) for i in 1:60];
# htop
PID USER PRI NI VIRT RES S CPU% MEM% TIME+ Command
25562 florian.o 26 0 11.3G 206M ? 0.0 1.3 0:04.24 julia
25567 florian.o 40 0 11.3G 192M ? 0.0 1.2 0:01.83 /Applications/Julia-0.5.app/Contents/Resources/julia/bin/julia -Ccore2 -J/Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib --compile=yes --depwarn=yes --bind-to 127.0.0.1 --worker jkYvc9op9KaIHMRn
25566 florian.o 40 0 11.3G 192M ? 0.0 1.2 0:01.86 /Applications/Julia-0.5.app/Contents/Resources/julia/bin/julia -Ccore2 -J/Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib --compile=yes --depwarn=yes --bind-to 127.0.0.1 --worker jkYvc9op9KaIHMRn
25565 florian.o 40 0 11.3G 191M ? 0.0 1.2 0:01.86 /Applications/Julia-0.5.app/Contents/Resources/julia/bin/julia -Ccore2 -J/Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib --compile=yes --depwarn=yes --bind-to 127.0.0.1 --worker jkYvc9op9KaIHMRn
25564 florian.o 40 0 11.2G 192M ? 0.0 1.2 0:01.78 /Applications/Julia-0.5.app/Contents/Resources/julia/bin/julia -Ccore2 -J/Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib --compile=yes --depwarn=yes --bind-to 127.0.0.1 --worker jkYvc9op9KaIHMRn
How do I read this? I can see that on a single process, creating that array consumes about 192M. If I share the array on 4 processes, it seems from htop
that each process consumes that same full amount of memory. I was under the impression that the idea of SharedArray
was to store the object in a central location and let all processes use it. I would have expected to see for the worker processes in the RES
column numbers like 165+(192-165)/4 = 171
or some thing like that. or is the htop
output misleading here?