linux - why the perl compiled code takes more memory? -
following sample code file name while.pl.
#!/usr/bin/perl use strict; use warnings; $i=0; while (1) { print "testing $i\n" ; $i++ ; sleep(1); } i have compiled code using
perlcc -o compiled while.pl then executed normal code while.pl , compiled code compiled. observed memory , cpu usage using ps command
ps axo %cpu,%mem,command | grep "while\|compiled" 0.0 0.0 /usr/bin/perl ./while.pl 0.0 0.1 ./compiled so questions are:
- why compiled code takes more memory compared
while.pl? - and how avoid memory usage of compiled perl code?
perl code compiled. doing compiling in advance instead of @ run-time.
it takes more memory load compiled form @ run-time because loading compiled-form loader on top of that's loaded.
Comments
Post a Comment