What is solution for this error?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting What is solution for this error?
# 22  
Old 04-29-2013
Quote:
Originally Posted by Akshay Hegde
I am sorry Don Cragun I did typing mistake I just came to know, please have a look on updated code..in
Code:
 #11

actually what I want to achieve is after the end of each function I want to write some message depending on condition specified in function...and at the end with another function I want to write to file.
it works if I split file, but for file with huge size I facing problem .
You have made it clear that the code you're showing us is not the code you're using. So you're asking us to make code that we can't see process data that we can't see to produce output that we can't see produce that output using less memory. Give us a break! We can't help you under these conditions.

Show us the actual code you're using. Show us meaningful samples of your 3 or more input files and the corresponding output produced by your code on that sample input. If you're unwilling to do this, we are all just wasting our time.
# 23  
Old 04-29-2013
I am sorry Don ..Don't mistake..I posted code which I am using, but I have not included all functions which I have written, I just modified little in thread(mistake done by me while typing) to make more clear, Hope you will understand.

I guess it will be related memory issue as it works in another pc
# 24  
Old 04-29-2013
I agree with Don. Without access to actual input, actual output, and desired output if it differs from the actual, there's no point in even beginning to look at the code.

If the script works fine on another system, then perhaps it's a resource limit issue, such as the process' heap limit.

Regards,
Alister
# 25  
Old 04-29-2013
Quote:
Originally Posted by Akshay Hegde
I am sorry Don ..Don't mistake..I posted code which I am using, but I have not included all functions which I have written, I just modified little in thread(mistake done by me while typing) to make more clear, Hope you will understand.
You have now made it even clearer that you haven't posted your actual code... We simply cannot help you if you don't.

We also need the input and output you expect.
# 26  
Old 04-29-2013
Your original question was why your program was crashing. I answered your question. Your program is running out of memory because it is creating giant arrays that consume all the memory. Apparently mawk crashes before gawk, but this is not a "bug in mawk". It's incredibly bad for this kind of program to be consuming several GB of RAM. I take it you're not predicting the global weather patterns or something like that. I find it ironic and amusing that posters on this group frequently criticize for one extra command in a script that makes the script clearer, but are not throwing up their hands in outrage over this kind of coding horror.

I think you have several choices, depending on the nature of the project, which you have totally failed to share with us:

1) If you want to get more swap space, you can post that as a separate thread.

2) If you want to "fix" the current program, I think it is way beyond the scope of this forum, because the program is way too complex, full of indecipherable code, code that you are even still editing as you post it. Based on the few functions you have posted, it would impossible for us to diagnose that kind of situation. On the other hand, you could post simple test cases for part of the project, using code tags to show input, and expected output.

3) You could re-engineer the program. Here you could ask general questions.

4) You could post for advice as to how to best handle the organizational challenges of dealing with a program that is failing.

Good luck, and at least now you know the cause of the crashes.
# 27  
Old 04-29-2013
Quote:
Originally Posted by hanson44
I find it ironic and amusing that posters on this group frequently criticize for one extra command in a script that makes the script clearer, but are not throwing up their hands in outrage over this kind of coding horror.
You shouldn't take advice so personally. You know enough to know when the useless cat habit will and won't hurt you.

The OP stated this program is a model, which implies "computationally intensive" and "memory-consuming"... Knowing it's a bad model would mean having some idea what it's for. Smilie
# 28  
Old 04-29-2013
Quote:
You shouldn't take advice so personally
I don't take it personally. Thank you for your concern. I also don't like those "useless cats" (MEOW!). They clutter code.

Quote:
having some idea what it's for
I also don't have the foggiest notion what the OP is trying to do. Smilie We can all agree at this point that it's "memory-consuming", at least the way it is currently coded.
Login or Register to Ask a Question

Previous Thread | Next Thread

2 More Discussions You Might Find Interesting

1. Ubuntu

What is solution for this error "tar: Exiting with failure status due to previous errors"?

Does anyone know what is solution for this error ?tar: Exiting with failure status due to previous errors from last 3 days I am trying to take backup of home/user directory getting again and again same error please anyone give me solution (8 Replies)
Discussion started by: Akshay Hegde
8 Replies

2. Shell Programming and Scripting

need the solution

Write a program to print all prime numbers from 1 to 300. (3 Replies)
Discussion started by: paniruddha
3 Replies
Login or Register to Ask a Question