Re: Calculating private and shared memory for processes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Feb 10, 2023 at 5:43 PM Rahul Gore (Nokia) <rahul.gore@xxxxxxxxx> wrote:
>
> I’m trying to find private and shared memory usage of each process in Linux. ...

Application should _not_ share memory across processes. That's a
security vulnerability. One app could corrupt memory, and cause
unpredictable results in another process.

You can check for processes which share memory by looking for the
GNU_SHARED section attribute in a [on-disk] program. There should be
no shared sections.

Tobias Klein's checksec may show programs which have GNU_SHARED . If
checksec does not check for it, then `readelf -l <program> | grep
GNU_SHARED` should reveal it.

I'm guessing private memory usage is an easier problem. Profiling
tools probably provide it. Tools like 'perf mem' and Valgrind provide
the information.

Jeff

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux