Is there some method or software that could purposely generate a lot of physical memory fragmentations on linux?
Hi, list Is there some method or software that could purposely generate a lot of physical memory fragmentations on Linux? I need to do some tests under such circumstances. Thank you for your attention to this matter.
On Tue, Jun 30, 2020 at 1:52 PM 孙世龙 sunshilong <sunshilong369@gmail.com> wrote:
Hi, list Is there some method or software that could purposely generate a lot of physical memory fragmentations on Linux?
I need to do some tests under such circumstances.
Thank you for your attention to this matter.
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Hi Just pseudo idea, if this is in user space, try to: allocate many blocks of memory using malloc, each having different size, keep the returned pointer, then randomly free() some of them, then malloc() again with different size -- regards, Mulyadi Santosa Freelance Linux trainer and consultant blog: the-hydra.blogspot.com training: mulyaditraining.blogspot.com
On Thu, 02 Jul 2020 15:29:18 +0700, Mulyadi Santosa said:
Just pseudo idea, if this is in user space, try to: allocate many blocks of memory using malloc, each having different size, keep the returned pointer, then randomly free() some of them, then malloc() again with different size
That will cause userspace malloc() to have fragmentation, but as far as the kernel is concerned it's all just 4K pages of user memory. Causing physical memory fragmentation will require abusing the kernel memory allocators such as kmalloc() and vmalloc() and friends.
Hi, Valdis Klētnieks, Mulyadi Santosa Thanks to both of you.
Just pseudo idea, if this is in user space, try to: allocate many blocks of memory using malloc, each having different size, keep the returned pointer, then randomly free() some of them, then malloc() again with different size
That will cause userspace malloc() to have fragmentation, but as far as the kernel is concerned it's all just 4K pages of user memory. Causing physical memory fragmentation will require abusing the kernel memory allocators such as kmalloc() and vmalloc() and friends.
I fully understand what you mean by "cause userspace malloc() to have fragmentation". I am sorry, maybe I mislead you. I just want there are no available free high order blocks(i.e 32KB,64KB, 128KB and etc) on the platform. How can I more efficiently and automatically achieve this goal?
participants (3)
-
Mulyadi Santosa -
Valdis Klētnieks -
孙世龙 sunshilong