All of lore.kernel.org
 help / color / mirror / Atom feed
* Understanding memory fragmentation in Linux kernel
@ 2018-12-31  6:02 Amit Agarwal
  2018-12-31  6:22 ` Manish Katiyar
  0 siblings, 1 reply; 6+ messages in thread
From: Amit Agarwal @ 2018-12-31  6:02 UTC (permalink / raw)
  To: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 624 bytes --]

Hi All, 

I am trying to understand memory fragmentation and how to understand
and/or analyze the same. 

Is there some detailed documentation on pagetypeinfo and buddyinfo files
present in the proc directory? Am I looking at right files to understand
if the memory is fragmented. 

Problem Description: 

One of the applications does a few 200-300Mb calloc's during start-up.
On one of the production servers, the application does not start up
although there should be enough RAM available for application to start.
I am suspecting that this is because of fragmentation and would like to
confirm the same.

-- 
Thanks,
-aka

[-- Attachment #1.2: Type: text/html, Size: 966 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Understanding memory fragmentation in Linux kernel
  2018-12-31  6:02 Understanding memory fragmentation in Linux kernel Amit Agarwal
@ 2018-12-31  6:22 ` Manish Katiyar
  2018-12-31  6:28   ` Amit Agarwal
  0 siblings, 1 reply; 6+ messages in thread
From: Manish Katiyar @ 2018-12-31  6:22 UTC (permalink / raw)
  To: Amit Agarwal; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 1143 bytes --]

On Sun, Dec 30, 2018, 10:03 PM Amit Agarwal <amit@amit-agarwal.co.in wrote:

> Hi All,
>
>
> I am trying to understand memory fragmentation and how to understand
> and/or analyze the same.
>
> Is there some detailed documentation on pagetypeinfo and buddyinfo files
> present in the proc directory? Am I looking at right files to understand if
> the memory is fragmented.
>
>
> Problem Description:
>
> One of the applications does a few 200-300Mb calloc's during start-up. On
> one of the production servers, the application does not start up although
> there should be enough RAM available for application to start. I am
> suspecting that this is because of fragmentation and would like to confirm
> the same.
>

How do you know it is because of memory ? If you have sufficient RAM then
it should be able to allocate. Does you application fail with ENOMEM ?

Without knowing the error code from application it's hard to suggest
anything.


-- 
> Thanks,
> -aka
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

[-- Attachment #1.2: Type: text/html, Size: 2227 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Understanding memory fragmentation in Linux kernel
  2018-12-31  6:22 ` Manish Katiyar
@ 2018-12-31  6:28   ` Amit Agarwal
  2018-12-31  6:54     ` Manish Katiyar
  2019-01-13 18:36     ` Richard Siegfried
  0 siblings, 2 replies; 6+ messages in thread
From: Amit Agarwal @ 2018-12-31  6:28 UTC (permalink / raw)
  To: Manish Katiyar; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 739 bytes --]

On 2018-12-31 06:22, Manish Katiyar wrote:

> How do you know it is because of memory ? If you have sufficient RAM then it should be able to allocate. Does you application fail with ENOMEM ? 
> Without knowing the error code from application it's hard to suggest anything.

There is no debugging enabled on site and there is nothing we can do now
to enable it and it is happening in only one site. But from whatever
logs I have, it is failing in calloc. 

I am not requesting help in resolving the issue with application (I will
be able to debug that), but only need help in understanding the memory
fragmentation part. ( I gave details of original problem so that I can
explain what I am trying to understand and why). 

-- 
Thanks, 
-aka

[-- Attachment #1.2: Type: text/html, Size: 1299 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Understanding memory fragmentation in Linux kernel
  2018-12-31  6:28   ` Amit Agarwal
@ 2018-12-31  6:54     ` Manish Katiyar
  2018-12-31  7:14       ` Amit Agarwal
  2019-01-13 18:36     ` Richard Siegfried
  1 sibling, 1 reply; 6+ messages in thread
From: Manish Katiyar @ 2018-12-31  6:54 UTC (permalink / raw)
  To: Amit Agarwal; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 931 bytes --]

On Sun, Dec 30, 2018, 10:28 PM Amit Agarwal <amit@amit-agarwal.co.in wrote:

> On 2018-12-31 06:22, Manish Katiyar wrote:
>
>
> How do you know it is because of memory ? If you have sufficient RAM then
> it should be able to allocate. Does you application fail with ENOMEM ?
> Without knowing the error code from application it's hard to suggest
> anything.
>
>
> There is no debugging enabled on site and there is nothing we can do now
> to enable it and it is happening in only one site. But from whatever logs I
> have, it is failing in calloc.
>
> I am not requesting help in resolving the issue with application (I will
> be able to debug that), but only need help in understanding the memory
> fragmentation part. ( I gave details of original problem so that I can
> explain what I am trying to understand and wh
>

Maybe you can try

echo m > /proc/sysrq-trigger


Or looking at /proc/buddyinfo



>
> --
> Thanks,
> -aka
>

[-- Attachment #1.2: Type: text/html, Size: 2726 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Understanding memory fragmentation in Linux kernel
  2018-12-31  6:54     ` Manish Katiyar
@ 2018-12-31  7:14       ` Amit Agarwal
  0 siblings, 0 replies; 6+ messages in thread
From: Amit Agarwal @ 2018-12-31  7:14 UTC (permalink / raw)
  To: Manish Katiyar; +Cc: kernelnewbies


On Sun, 2018-12-30 at 22:54 -0800, Manish Katiyar wrote:
> 
> Maybe you can try
> 
> echo m > /proc/sysrq-trigger
I will check this and see if this can provide something useful for me.
Did not know about this.

> 
> Or looking at /proc/buddyinfo
I looked at buddyinfo and hence asked for more documentation on that.
Does the pages that buddyinfo list under any "order at" are contigeous
or are they located somewhere in memory? For ex: If buddyinfo shows 2
pages for 0th order, does it mean that there are 2 contigeous pages of
2M each?

> 

-- 
Thanks,
-aka



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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Understanding memory fragmentation in Linux kernel
  2018-12-31  6:28   ` Amit Agarwal
  2018-12-31  6:54     ` Manish Katiyar
@ 2019-01-13 18:36     ` Richard Siegfried
  1 sibling, 0 replies; 6+ messages in thread
From: Richard Siegfried @ 2019-01-13 18:36 UTC (permalink / raw)
  To: kernelnewbies


[-- Attachment #1.1.1: Type: text/plain, Size: 702 bytes --]

On 31/12/2018 07:28, Amit Agarwal wrote:
> I am not requesting help in resolving the issue with application (I will
> be able to debug that), but only need help in understanding the memory
> fragmentation part. ( I gave details of original problem so that I can
> explain what I am trying to understand and why). 
To get a deeper understanding of memomry managment (and fragmentation)
on linux I would recommend the Memory Managment case study chapter of
"Modern Operating Systems" from Andrew S Tanenbaum.

It has a own Case Study Study Part with Chapters for several modern
Operating Systems, one being Linux. There it covers its Memory managment
in nice detail.

Thanks,
-- Richard


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-01-13 18:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-31  6:02 Understanding memory fragmentation in Linux kernel Amit Agarwal
2018-12-31  6:22 ` Manish Katiyar
2018-12-31  6:28   ` Amit Agarwal
2018-12-31  6:54     ` Manish Katiyar
2018-12-31  7:14       ` Amit Agarwal
2019-01-13 18:36     ` Richard Siegfried

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.