- Notifications
You must be signed in to change notification settings - Fork285
Open
Description
Hi all.
I'm using Linux, however don't know well about shared memory and shared library concept.
I'd like to use ps_mem to calculate and analyze my application's memory usage but I got a question.
My application uses a big shared library. (.so files)
It's architecture is as below:
- My application is composed of part
A
andB
. A
is run as a process.A
forksB
, so thatB
is run as another process.A
can forksB
many times.B
uses a big shared libraryC
.
Case 1:A
forksB
once.
10.6 MiB + 614.5 KiB = 11.2 MiB A106.0 MiB + 28.5 MiB = 134.4 MiB B
Case 2:A
forksB
twice.
12.6 MiB + 432.5 KiB = 13.0 MiB A180.6 MiB + 59.3 MiB = 239.9 MiB B (2)
Case 3:A
forksB
three times.
14.6 MiB + 350.5 KiB = 15.0 MiB A270.5 MiB + 74.1 MiB = 344.6 MiB B (3)
I thought that the big shared library,C
might be shared, so thatB
's shared memory size might be almost same.
But, according to the test result, its size might be multiplied as the number of forks.
Why is the shared size multiplied?
Metadata
Metadata
Assignees
Labels
No labels