LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   RAM consumption by Gcore (https://www.linuxquestions.org/questions/linux-newbie-8/ram-consumption-by-gcore-4175597318/)

dipanchatterjee 01-12-2017 01:43 PM

RAM consumption by Gcore
 
Hello Expert,

Am trying to find a way to identify, how much RAM is used by gcore.
Am taking gcore for rpd process. rpd process is around 28MB running in the physical memory or ram.

Is there any way I get to know how much ram is consumes by gcore, while taking core for the rpd process.

Any help is appreciated.

Regards
Dipan

rtmistler 01-12-2017 02:41 PM

Hello Dipan and welcome to LQ.

What have you tried to use to determine how much RAM any process is using in your system? Do you know how to determine this for any general process? Have you looked at the top command?

dipanchatterjee 01-13-2017 03:24 AM

Hello rtmistler,

Thanks for your response.

Am new to Linux.
Yes I ran the top -bSH and ps -aus command.
I could find the PID value of the rpd process and using that pid value I can take the gcore.

But I can't see the PID of gcore (nor in top or neither in syslogs).
So is there any command that can show me how much physical memory or ram is used while running the gcore command.


Regards
Dipan

rtmistler 01-13-2017 07:07 AM

I'll agree that it is difficult to rely on top because gcore usually works pretty fast. Commands like "ps -aux" are useful to show some of this information; however there are arguments that it is not a true representation of the actual memory in use, but instead the maximum allocation made by the process. The smaps file for any process has a lot of detail about memory allocations made by the process. All this depends on whether or not the process is still around however. If the gcore completes, all process information will be removed.

Is there a problem with running it, or are you just curious how much RAM it might be using?

dipanchatterjee 01-13-2017 08:20 AM

No there is no actual problem but am just curios about one thing here it is.

last pid: 2503; load averages: 0.23, 0.45, 0.24 up 0+00:05:53 16:06:33
138 processes: 2 running, 117 sleeping, 2 zombie, 17 waiting

Mem: 196M Active, 84M Inact, 60M Wired, 264M Cache, 69M Buf, 1374M Free
Swap: 151M Total, 151M Free

PID USERNAME PRI NICE SIZE RES STATE TIME WCPU COMMAND

2383 root 4 0 41856K 24616K kqread 0:00 0.00% rpdf

What I see that the RES value of the rpdf process is around 24 MB.


Now when I take the gcore, I do not see that the core dumps the same amount of data. Gcore file written in the hard-disk is lesser than the rpdf RES value.
I expect it to be around 24MB same as RES of rpdf. Even if I have enough storage in the directory say 3 GB (which is sufficient for the gcore).
It dumps only 18-19 MB of data.

So I was wondering why is that so. Shouldn't it take the complete snapshot of the process.

rtmistler 01-13-2017 08:31 AM

As I've said, the ps command statistics are largely argued by many persons about whether or not things like memory usage are true representations. I suggest you perform a web search with terms like "linux determine memory use by a process" or similar types of terms and review the various discussions. There are also questions on other sites about how to determine memory use by a process where the answers show the use of ps, but also caution about it, and then follow on discussions ensue about the accuracy versus not. I agree, the numbers cited in a ps command output do not appear to be accurate.

rob.rice 01-15-2017 02:52 PM

Quote:

Originally Posted by dipanchatterjee (Post 5654247)
Hello rtmistler,

Thanks for your response.

Am new to Linux.
Yes I ran the top -bSH and ps -aus command.
I could find the PID value of the rpd process and using that pid value I can take the gcore.

But I can't see the PID of gcore (nor in top or neither in syslogs).
So is there any command that can show me how much physical memory or ram is used while running the gcore command.


Regards
Dipan

htop is alot better for what your doing top will show the top CPU load
htop will show every process running zombied and swapped out
htop is to top as less is to more


All times are GMT -5. The time now is 11:37 AM.