Page 1 of 1

How to Avoid "Not enough Memory" error in c progra

Posted: Thu Aug 30, 2007 2:49 am
by honey_hack
Hi friends.. i am making a project in 'C' but as soon as include more then 2 .exe files in my progaram with the help of 'execl' command it gives the error............
please help

Posted: Mon Sep 03, 2007 2:51 am
by Hacksign
seems u memory is too small

try get a memory card ~~(i don't know wether i describe my opinion exactly)
:)

Posted: Mon Sep 03, 2007 9:14 am
by jack krauser
Hacksign wrote:seems u memory is too small

try get a memory card ~~(i don't know wether i describe my opinion exactly)
:)
yeah i agree this must be the promblem :wink:

Re: How to Avoid "Not enough Memory" error in c pr

Posted: Thu Sep 06, 2007 3:53 pm
by Captain Segfault
honey_hack wrote:Hi friends.. i am making a project in 'C' but as soon as include more then 2 .exe files in my progaram with the help of 'execl' command it gives the error............
please help
What operating system? When you say "with the help of execl" what exactly do you mean? You're having one program execl the other? You're getting this problem at runtime?

I'll bet this isn't actually a lack of memory.

Re: How to Avoid "Not enough Memory" error in c pr

Posted: Thu Sep 06, 2007 7:11 pm
by jack krauser
Captain Segfault wrote:
honey_hack wrote:Hi friends.. i am making a project in 'C' but as soon as include more then 2 .exe files in my progaram with the help of 'execl' command it gives the error............
please help
What operating system? When you say "with the help of execl" what exactly do you mean? You're having one program execl the other? You're getting this problem at runtime?

I'll bet this isn't actually a lack of memory.
and if it's not the memory then what the hell is? :? :?

Re: How to Avoid "Not enough Memory" error in c pr

Posted: Fri Sep 07, 2007 1:09 am
by Captain Segfault
jack krauser wrote: and if it's not the memory then what the hell is? :? :?
Something else that manifests as a "not enough memory" error.

Just because it is running out of memory does not mean that lack of memory is the problem any more than a car running out of gas in 5 minutes would indicate that it needs a bigger gas tank.

Re: How to Avoid "Not enough Memory" error in c pr

Posted: Fri Sep 07, 2007 8:27 am
by jack krauser
Captain Segfault wrote:
jack krauser wrote: and if it's not the memory then what the hell is? :? :?
Something else that manifests as a "not enough memory" error.

Just because it is running out of memory does not mean that lack of memory is the problem any more than a car running out of gas in 5 minutes would indicate that it needs a bigger gas tank.
mhhhmmmmmmmmm...... maybe it could be that :wink: :lol:

Posted: Sat Sep 08, 2007 6:18 am
by honey_hack
thank u to all of u for ur suggestions,,,,,,,,,,,,
actually i tried all go that,, but all in vain...
if i run all files saperately they run very good.. but i call all of them in my main progaram they generate error..... what i think is that.. there should be some system setting to solve that problem
the command which i am using is "execl("file name","argument 1","argument 2","argument 3");", it's an 'c' command to run the child process...............

Posted: Sat Sep 08, 2007 2:57 pm
by Captain Segfault
the command which i am using is "execl("file name","argument 1","argument 2","argument 3");", it's an 'c' command to run the child process...............[/b]
You have the syntax slightly wrong; this may be your problem. It's actually execl("file name", "argument 0", "argument 1",...). So, if I wanted to execl the equivalent of "ls -l /" the command would be:
execl("/bin/ls", "ls", "-l", "/");

Note that execl does not return when it succeeds! It means "replace the current process with that one". You couldn't use it to run multiple commands from a single main function unless you're forking.

Also, what OS are you running?

Posted: Tue Sep 18, 2007 6:06 am
by honey_hack
Captain Segfault wrote:
the command which i am using is "execl("file name","argument 1","argument 2","argument 3");", it's an 'c' command to run the child process...............[/b]
You have the syntax slightly wrong; this may be your problem. It's actually execl("file name", "argument 0", "argument 1",...). So, if I wanted to execl the equivalent of "ls -l /" the command would be:
execl("/bin/ls", "ls", "-l", "/");

Note that execl does not return when it succeeds! It means "replace the current process with that one". You couldn't use it to run multiple commands from a single main function unless you're forking.

Also, what OS are you running?
thanks... i'll try that.. by the way i am using XP..

Posted: Tue Sep 18, 2007 12:13 pm
by jack krauser
honey_hack wrote:
Captain Segfault wrote:
the command which i am using is "execl("file name","argument 1","argument 2","argument 3");", it's an 'c' command to run the child process...............[/b]
You have the syntax slightly wrong; this may be your problem. It's actually execl("file name", "argument 0", "argument 1",...). So, if I wanted to execl the equivalent of "ls -l /" the command would be:
execl("/bin/ls", "ls", "-l", "/");

Note that execl does not return when it succeeds! It means "replace the current process with that one". You couldn't use it to run multiple commands from a single main function unless you're forking.

Also, what OS are you running?
thanks... i'll try that.. by the way i am using XP..
me too but i'm thinking to take linux :wink: and ubuntu

Posted: Tue Sep 18, 2007 1:13 pm
by <<D.A.>>
By the way you said you are using slackware

Posted: Tue Sep 18, 2007 5:34 pm
by jack krauser
<<D.A.>> wrote:By the way you said you are using slackware
i was but i just buy a new pc and i'm thinking what to use again :wink: