Checking memory size of app

does anyone how to check the current rss memory assigned to an app:
myApp is failing as it hits the limit of the rss memory, which we are trying to trace what is causing this…

Nov 30 07:06:58 fx30 user.warn kernel: [ 1726.070345] myApp invoked oom-killer: gfp_mask=0x142004a(GFP_NOFS|__GFP_HIGHMEM|__GFP_HARDWALL|__GFP_MOVABLE), nodemask=(null), order=0, oom_score_adj=0
Nov 30 07:06:58 fx30 user.warn kernel: [ 1726.070375] CPU: 0 PID: 12767 Comm: myApp Tainted: G O 4.14.253 #1
Nov 30 07:06:58 fx30 kernel: [ 1726.070690] Task in /myApp killed as a result of limit of /myApp
Nov 30 07:06:58 fx30 kernel: [ 1726.070725] Memory cgroup stats for /myApp: cache:0KB rss:39732KB rss_huge:0KB shmem:0KB mapped_file:0KB dirty:0KB writeback:0KB inactive_anon:0KB active_anon:39788KB inactive_file:0KB active_file:0KB unevictable:0KB
Nov 30 07:06:58 fx30 kernel: [ 1726.070866] [ 1445] 0 1445 15201 10218 27 0 0 0 myApp
Nov 30 07:06:58 fx30 user.err kernel: [ 1726.070920] Memory cgroup out of memory: Kill process 1445 (myApp) score 1024 or sacrifice child
Nov 30 07:06:58 fx30 user.err kernel: [ 1726.070962] Killed process 1445 (myApp) total-vm:60804kB, anon-rss:39788kB, file-rss:1084kB, shmem-rss:0kB
Nov 30 07:06:58 fx30 kernel: [ 1726.086226] oom_reaper: reaped process 1445 (myApp), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB

does “top” command help?

Did you set maxMemoryBytes in .adef?

no I didn`t but the problem is that the assigned RAM keeps increasing and we need to find out what is actually increasing it.
but top command worked, at least we can track from the app the increase of the memory

I do get a permission denied error when running the command from the legato app:
/usr/bin: Permission denied

as I am trying to run:

in the app I have specified that the sandboxed: false

you can do like this with unsandboxed application:


	system("/usr/bin/top -b -n 1 > /tmp/top.txt");

	LE_INFO("Hello, world. 123");


It is working on my WP76 module with FW R13