I have installed Matlab 2020a in Ubuntu 20.04. When trying to run a code the Matlab program is getting killed, but it runs in another system perfectly fine. Checking resources while running shows that 8gb RAM and 10gb Swap are getting exhausted before getting killed.
Tried changing Java heap memory to around 1.5GB, as well as unchecking the maximum array limit option from workspace settings in Matlab preferences.
dmseg
output has these lines
oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1000.slice/user@1000.service,task=MATLAB,pid=14659,uid=1000
[ 2166.872604] Out of memory: Killed process 14659 (MATLAB) total-vm:24372208kB, anon-rss:7121400kB, file-rss:0kB, shmem-rss:4kB, UID:1000 pgtables:35440kB oom_score_adj:0
syslog
has these lines
kernel: [16207.494793] Out of memory: Killed process 50687 (MATLAB) total-vm:22123872kB, anon-rss:6511936kB, file-rss:0kB, shmem-rss:92kB, UID:1000 pgtables:31144kB oom_score_adj:0
/usr/lib/gdm3/gdm-x-session[1638]: (EE) client bug: timer event9 tap: scheduled expiry is in the past (-998ms), your system is too slow
kernel: [16208.142159] oom_reaper: reaped process 50687 (MATLAB), now anon-rss:0kB, file-rss:0kB, shmem-rss:108kB
Is there a way I can limit the memory and swap used by matlab
? Have tried ulimit
with -m
and -v
flags, but then matlab
won't open at all.
This issue is not there in windows in the same machine, so the issue seems only for MATLAB in Ubuntu. Is there a way to make it work in ubuntu?
top
orhtop
to see who is eating up memory. Also look at log files, JAVAs and ubuntus in /var/log ... especially syslog and dmesg. – Soren A May 07 '20 at 08:25matlab
gets killed, anddmesg
notifies of theout of memory
issue for matlab. – Praveen May 07 '20 at 08:27htop
and it showsmatlab
eating up memory while running the code. – Praveen May 07 '20 at 08:28