I am using a SunOS 5.8 box, having 4 processors. I have written a
program that parses an input file and creates a binary version of the
file. When I execute my program on a really large file(>1 GB), the
process seems to run fine for about 10 min and then goes into the
'sleep' state (even when there are no other processes executing).
Executing 'top' command shows that the process used approx. 5.55 CPU
time and had a size of 816M. Top also showed that there was free
memory (2022M) when the process went to 'sleep'.
If I split my input file into smaller chunks of 100MB and then append
the output to one file, the program executes (5-6) such files and then
begins to hang for the remaning files.
If I don't append to the same output file, then individual runs of the
program works fine.
Any ideas on what's going wrong??
Thanks,
Flavia
How big is your output file?
If it stops at 2GB, you have made a program without using largefile
support (man largefile), and also your program does not stop at an
error of a system call such as write().
A good debugging is with truss (man truss).
Rgds
Michael
--
Michael Tosch @ hp : com
>I am using a SunOS 5.8 box, having 4 processors. I have written a
>program that parses an input file and creates a binary version of the
>file. When I execute my program on a really large file(>1 GB), the
>process seems to run fine for about 10 min and then goes into the
>'sleep' state (even when there are no other processes executing).
>Executing 'top' command shows that the process used approx. 5.55 CPU
>time and had a size of 816M. Top also showed that there was free
>memory (2022M) when the process went to 'sleep'.
What does iostat say?
If this is on a ufs filesystem try setting the kernel variable
ufs:ufs_WRITES to 0.
In /etc/system so it's on in the next boot:
set ufs:ufs_WRITES = 0
immediately (only when the system is idle or it may hang!!!!):
echo ufs_WRITES/W0 | adb -wk
Casper
truss -f -o truss.log myprogram <inputfile>
One run of the program, executed for 3 hours and then showed a
lwp_sema_wait in the truss log.
A subsequent run, executed for 9 hours and created the output file.
If I run the program without truss, then the program goes to sleep in
10 min.
Any thoughts??
Thanks,
Flavia.