Re: 4ge using up too much processor time
Posted in 1999
>I have discovered a 4gl program while seems to be slowing down our >system as it is >using a lot of processor time. After running for a few hours it had used >about 25 seconds of processor time and was growing. Every other process >had used very little processing time. >We are running Online 5.08 on SCO Openserver 5.04 with 256 Mb Ram with 2 >pentium pro processors. I believe that something may be wrong as the >program should not demand so much processor time. The program does >select a lot of data and creates temp tables. I realise that this is not >much to go on but I am looking for ideas for things to chek for in the >code which may be standard things to check for e.g. closing cursors. In >fact is this normal anyway ? could it just be the case that the nature >of the program will mean that it will use up a lot of CPU time? > I once had a similar problem. My program used to take 2 1/2 days to run. I don't know the specifics of your program but you can compare it with mine. Here goes: my program was selecting approximately 2000 records from table A which had about 1,000,000 records. For each record selected the program searched for corresponding records in table B which had 1,500,000 records. This process ate up processor time and took 2 and 1/2 days. So what I did was I selected all the possible records that would be used in table B into a temporary table then foreach of my first records I selected from the temporary table instead of from table B. My program went from 2 1/2 days to 35 MINUTES. Another thing I can think of is Freeing your cursors. Closing them merely erases the tempory table memory, but the space for the cursor itself still remains. Enough declare statements will eat up your memory.