MATLAB Compiler Standalone Application hogs memory in Linux
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I tried compiling a simple script into a standalone application in Linux. When I execute my application, it takes up ~100 MB of my memory.
I tried running multiple instances of the same application, and each takes up ~100 MB. Does the MATLAB Compiler Runtime start a new instance every time I run a compiled application?
Here's what I get when I run top -c in the linux console (Compiled application is MCRtest) :
Cpu(s): 3.3%us, 1.0%sy, 0.0%ni, 95.0%id, 0.7%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 1025712k total, 981548k used, 44164k free, 41012k buffers
Swap: 916476k total, 62540k used, 853936k free, 265656k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
950 root 20 0 98.5m 61m 16m S 2.3 6.1 37:55.36 /usr/bin/X :0 -nr -verbose -auth /var/run/gdm/auth-for-gdm-WVqBa5/database -noli
5634 lilboy 20 0 566m 322m 57m S 1.7 32.1 6:15.00 /usr/local/MATLAB/R2011a/bin/glnx86/MATLAB
5283 lilboy 20 0 2620 1016 808 R 1.0 0.1 0:18.01 top -c
8233 root 20 0 440m 105m 41m S 0.7 10.5 0:07.36 ./MCRtest
8407 root 20 0 438m 101m 41m S 0.7 10.1 0:06.86 ./MCRtest
326 root 20 0 0 0 0 S 0.3 0.0 0:01.55 [jbd2/sda1-8]
1953 lilboy 20 0 30492 7756 5388 S 0.3 0.8 0:20.01 /usr/lib/vmware-tools/bin32/vmware-user-loader --blockFd 6
1989 lilboy 20 0 92100 12m 8672 S 0.3 1.3 0:19.10 /usr/bin/gnome-terminal -x /bin/sh -c '/home/lilboy/Desktop/Matlab2011a'
8231 root 20 0 439m 101m 41m S 0.3 10.2 0:07.58 ./MCRtest
8346 root 20 0 437m 102m 41m S 0.3 10.2 0:07.22 ./MCRtest
1 root 20 0 2876 1392 1048 S 0.0 0.1 0:01.48 /sbin/init
And here's the test code I used to compile:
t = 0:10;
y2 = 1.1.^t; % 10% growth
plot(t, y2)
value1 = y2(2);
% Finding time when value1 doubles
x = log(2*value1)/log(value1);
% The value doubles every x amount of time.
t_n = (1:10)*x;
y_n = 1.1.^t_n;
plot(t_n,y_n)
My system (VM Ware system):
Processor: 1.6Ghz i7 (Single core on VM)
Memory: 1 GiB
OS: Linux Mint 10
Is anyone experiencing the same thing? Is there any way I can reduce the memory footprint?
Thanks in advance.
回答(1 个)
Kaustubha Govind
2011-11-23
Yes, I do believe that a new instance of the MCR is started for every instance of the compiled executable. That is what is likely taking the 100MB.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!