how can i avoid virtual memory problem

Hi
i was trying to compile one of my project source file which is neary 2MB large.

i couldnt compile it, instead getting an error like "insufficient virtual memory"

how come i get away with this problem ,please suggest.

thanks

Is the error from cc, or is it ld (the linker) who is complaining? How much swap and memory are on the system - total VM?

If you have two MB in a single source file, and you wrote it, you need to work on re-writing it into modules....right now. That's the root cause of the problem.

Otherwise, it's probably because of the memory declared in your code, and ld is the problem. There are workarounds like using heap memory in your code, or increasing VM on your box.