By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,807 Members | 1,492 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,807 IT Pros & Developers. It's quick & easy.

malloc fails

P: 1
hi,

in my code i am creating a tree, which have a 20 levels and and each level we have 10 nodes. i.e every node can have a 10 children. for them i am allocating memory for each node.

each node is stracuture which occupies the memmory around 40 bytes.

i have 456 files, each file have more then 18000 data, i.e. for each file 18000+ nodes are created. when coressponding output is written to ourfile for every file, memeory allocated is made free.



but after o the same for 450 files....my c code fails...

nor i am looking that how can i reuse the memory which had been free by my progrm again.



can anybody help.
Sep 18 '06 #1
Share this Question
Share on Google+
1 Reply


100+
P: 144
hi,

in my code i am creating a tree, which have a 20 levels and and each level we have 10 nodes. i.e every node can have a 10 children. for them i am allocating memory for each node.

each node is stracuture which occupies the memmory around 40 bytes.

i have 456 files, each file have more then 18000 data, i.e. for each file 18000+ nodes are created. when coressponding output is written to ourfile for every file, memeory allocated is made free.



but after o the same for 450 files....my c code fails...

nor i am looking that how can i reuse the memory which had been free by my progrm again.



can anybody help.

A listing of the problem code as well as what exactly the reported error is would be helpful.
Sep 18 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.