foss-for-synopsys-dwc-arc-processors/linux

memory leak issue.

joshualin-petaio opened this issue · 7 comments

Hi expert,

When I run openamp with echo_test example. I found it has memory leak issue after execute the echo_test application. Then I use linux command "free" to monitor the memory usage at runtime. I found "free" has memory leak also. Do you know why the linux basic function has memory leak issue ?
My environment is HS38x2.

Thanks, Joshua

Hi @joshualin-petaio,
What kernel version do you use?
We've fixed one memory leakage issue in October 4fd9df10cb.
Can it be your case?

Hi @pavelvkozlov ,
Thank you for your reply. I'm using buildroot 2022.02 with linux-5.16. I don't konw how to find the kernel commit. But I check the file: arch/arc/include/asm/pgtable-levels.h. It's wrong code: "define pmd_pgtable(pmd) ((pgtable_t) pmd_page_vaddr(pmd))". Should I use linux-5.17 directly or poll the right commit ?

Thanks, Joshua

If you want to continue, use your 5.16 kernel you have to apply this patch manually. As this patch was provided in time of Linux 6.x not all archives with 5.x kernels contain this fix but stable releases should. The 5.15.97 is a long term supported kernel and it should contain this fix, so you can try to change kernel version in your buildroot setup from 5.16 to 5.15.97 or even try 6.1.15. But a complete rebuild may be required.

@joshualin-petaio could you please elaborate on symptoms you see, based on which you conclude there's a memory leak?

Hi @abrodkin , I deliver the full test to you. I just do free command to monitor the memory usage after boot done. Then the used memory will increase until out of memory.

Hi @pavelvkozlov , I use kernel 5.16 with that patch manually. And this issue was fixed indeed. Beside using patch, maybe I will try other kernel version you recommend later.

Thanks, Joshua
memory_leak_issue.log

@joshualin-petaio glad to know your issue is fixed with the suggested fix. May we close this issue now?

Hi @abrodkin , @pavelvkozlov ,

Thank you for your help ! This issue can close now.

Thanks, Joshua