System Crash due to the usage of "Loop Condition"

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
abhishekachrekar
Participant
Posts: 45
Joined: Wed May 02, 2007 8:30 am
Location: Prague, Czech Republic

System Crash due to the usage of "Loop Condition"

Post by abhishekachrekar »

Hi,

I have a requirement where I need to split a free text column (which mostly exceeds 255 chars) coming in the input row and insert them as multiple rows in the output with each having splitted chunk from the free text column.

So, I have used Loop Condition in Transformer to split the columns with the following Loop Varaibles:
stgTrim -> Col1[stgStart+1,132]
stgStart -> stgStart+132 (stgStart initialized to 0)
stgCnt -> @Iteration

Loop While -> stgTrim<>''

The logic works fine with sample records.
But when I run this job with the actual file, DS hangs and the server crashes.

After analysis, it was found that there was a big peak in the memory usage every time I had run that job which killed the server.

So I wish to know an alternative to implement this or How can I restrict the memory usage of this job.

Thanks and Regards,
Abhishek
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Sounds like a bug, something you should report to your official support provider and see if it is a known issue with a patch or other resolution available.
-craig

"You can never have too many knives" -- Logan Nine Fingers
qt_ky
Premium Member
Premium Member
Posts: 2895
Joined: Wed Aug 03, 2011 6:16 am
Location: USA

Post by qt_ky »

What is the longest possible length of the incoming free text column?

Have you tried lowering the "loop iteration warning threshold" in the Loop Variable tab of the Stage Properties window from the default of 10000?

As per the docs covering loop variables, it is possible to enter an infinite loop. I would guess if that happens, it could eat up your memory before hitting the default threshold of 10000. It's not really a scenario I want to recreate to test it. :D

Another possible approach you could test, still using a loop condition, is to first set a stage variable to the length of the incoming free text column, such as svLen. Then use a new loop variable, such as lvStartPos as the while condition, where the new loop variable would change in each iteration.

So on the first pass, loop while: lvStartPos + 1 <= svLen (lvStartPos initializes to 0). In the loop, increment lvStartPos by 132, or your chunk size.
Choose a job you love, and you will never have to work a day in your life. - Confucius
abhishekachrekar
Participant
Posts: 45
Joined: Wed May 02, 2007 8:30 am
Location: Prague, Czech Republic

Post by abhishekachrekar »

Thanks Craig,

Thanks Eric,
I like your suggestion. But just I am afraid of attempting it as we have a delivery this weekend. I have incorporated the same logic in Stored Procedure in DB2. Just waiting till Friday to test the same.
Will post the results of my tests.

REgards,
Abhishek
Regards,
Abhishek
Post Reply