Using unix without the pretty OS...

I am running an eMac with 512MB Ram and want to run some memory hungry perl scripts. It seems that the vast majority of my RAM is given over to running the aqua interface - something that I would like the option of it not doing.

Basically, can I run my eMac as a basic unix box without the interface (which, I presume, will allow me to access considerably more of the RAM than I can at the moment)?

On a secondary point, I tried doing this from single-user mode but was prevented from doing any editing of files in that mode. BUT I found that my RAM was still very limited i.e. I ran a memory hungry process and it choked at the same point that it choked when I was running the script with the regular aqua business running.

What's going on, and what are my options (aside from shelling out for more RAM...)?

Thanks

Mike

eMac Mac OS X (10.4.8) eMac 1.42 GHz

eMac Mac OS X (10.4.3) G4 iBook

eMac, Mac OS X (10.4.3), G4 iBook

Posted on Oct 21, 2006 11:49 AM

Reply
11 replies

Oct 21, 2006 12:54 PM in response to Mike and Hannah Hart

Hi Mike,
It doesn't work consistently on Tiger but you can try logging in with the following username:

console


Don't put anything in the password field.

512MB is cramped but doable for most purposes. If this is the only problem you're having then it may not be worth it to get more RAM but it usually helps to get more.

It's also possible that you're running into a limit on the number of processes. It's easy to fork processes in Perl and while parallel processing helps up to a point, I've seen many scripters go overboard. Most of the scripts crash when a fork fails but maybe this one handles the error and keeps trying to spawn new ones. That could also cause a noticeable slowdown. While the script is running you could run "ps -auxww" and see if you have more than a hundred processes.
--
Gary
~~~~
Food for thought is no substitute for the real thing.
-- Walt Kelly, "Potluck Pogo"

Oct 21, 2006 4:08 PM in response to Mike and Hannah Hart

i.e. I ran a memory hungry process and it choked at the same point that it choked when I was running the script with the regular aqua business running.

*nix boxes don't choke when they have too little memory, they slow to a crawl because they're swapping and in extreme cases thrashing. If the box is swapping, it would be swapping to the swap files in /var/vm. These appear to be regular files, so if you do:

ls -l /var/vm

you should see mod times on them.

You may also want to try running (in another terminal window):

top -o cpu

while you run these perl scripts to see where resources are going.

Roger

Oct 22, 2006 12:30 AM in response to Mike and Hannah Hart

Thanks for the responses so far.

So - here's another example then. I want to run a C program and I want to malloc as much memory as I can for a char array. At the moment I seem to be limited to around 6-7MB before I get a segmentation fault. I want to have more like 100MB to achieve what I want to do.

And another example - I wanted to do an 'fgrep -f fileA fileB' where fileA had 1.4 million lines and I ran out of memory.

The '>console' login seems pretty neat (and it worked for me) but the memory limitations seemed still to be present.

Looks like I should be reaching for my Mastercard, methinks...

eMac Mac OS X (10.4.8)

Oct 22, 2006 3:30 PM in response to Mike and Hannah Hart

Before you do that, you should probably take a look at the kernel parameters. Apple has some "interesting" settings that quite probably need to be changed for the stuff that you're doing.

sysctl -a | more

Roger

Oct 23, 2006 3:19 PM in response to Mike and Hannah Hart

The ulimit limits are manipulated through the shell. The sysctl parameters can be manipulated through the sysctl command, and made persistent by putting them in /etc/sysctl.conf (which will need to be created). Some kernel parameters (usally of the on/off type) can be changed on a running machine, others require a restart.

On my XServe, I've found that the /etc/rc scripts sets some values after /etc/sysctl.conf is processed, so you may want to move those parameters into /etc/sysctl.conf and comment out the lines in /etc/rc.

The sysctl man page will explain the syntax involved for both the command line and sysctl.conf.

From Nils' post, it sounds more like ulimit, especially is you're running this stuff as an unprivledged user may be a better first choice. Kernel tuning isn't really for the faint of heart.

/etc/bashrc will make any ulimit changes persist.

Roger

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Using unix without the pretty OS...

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.