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

Discussion about hacker.org's server
Post Reply
User avatar
honey_hack
Posts: 16
Joined: Tue Aug 21, 2007 2:15 am

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

Post 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
User avatar
Hacksign
Posts: 53
Joined: Mon Jul 16, 2007 9:14 am
Location: China
Contact:

Post by Hacksign »

seems u memory is too small

try get a memory card ~~(i don't know wether i describe my opinion exactly)
:)
User avatar
jack krauser
Posts: 1005
Joined: Wed Aug 29, 2007 5:45 pm
Location: greece
Contact:

Post 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:
hacker is a life style. its one that alters how you think, you perception of reality, your way of dealing with things in general, as well as things so common as how you talk, how you carry yourself, and even when and how long you sleep.

by Loyal_Dark
Captain Segfault
Posts: 67
Joined: Sat May 05, 2007 6:11 pm
Location: San Carlos, CA
Contact:

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

Post 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.
User avatar
jack krauser
Posts: 1005
Joined: Wed Aug 29, 2007 5:45 pm
Location: greece
Contact:

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

Post 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? :? :?
hacker is a life style. its one that alters how you think, you perception of reality, your way of dealing with things in general, as well as things so common as how you talk, how you carry yourself, and even when and how long you sleep.

by Loyal_Dark
Captain Segfault
Posts: 67
Joined: Sat May 05, 2007 6:11 pm
Location: San Carlos, CA
Contact:

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

Post 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.
User avatar
jack krauser
Posts: 1005
Joined: Wed Aug 29, 2007 5:45 pm
Location: greece
Contact:

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

Post 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:
hacker is a life style. its one that alters how you think, you perception of reality, your way of dealing with things in general, as well as things so common as how you talk, how you carry yourself, and even when and how long you sleep.

by Loyal_Dark
User avatar
honey_hack
Posts: 16
Joined: Tue Aug 21, 2007 2:15 am

Post 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...............
Captain Segfault
Posts: 67
Joined: Sat May 05, 2007 6:11 pm
Location: San Carlos, CA
Contact:

Post 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?
User avatar
honey_hack
Posts: 16
Joined: Tue Aug 21, 2007 2:15 am

Post 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..
User avatar
jack krauser
Posts: 1005
Joined: Wed Aug 29, 2007 5:45 pm
Location: greece
Contact:

Post 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
hacker is a life style. its one that alters how you think, you perception of reality, your way of dealing with things in general, as well as things so common as how you talk, how you carry yourself, and even when and how long you sleep.

by Loyal_Dark
<<D.A.>>
Posts: 647
Joined: Wed Aug 15, 2007 5:16 pm
Location: nowhere

Post by <<D.A.>> »

By the way you said you are using slackware
User avatar
jack krauser
Posts: 1005
Joined: Wed Aug 29, 2007 5:45 pm
Location: greece
Contact:

Post 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:
hacker is a life style. its one that alters how you think, you perception of reality, your way of dealing with things in general, as well as things so common as how you talk, how you carry yourself, and even when and how long you sleep.

by Loyal_Dark
Post Reply