Archive for August, 2008

Crystal Reports 8.5 with multi processors

August 5, 2008

I help support an app written in VB6 that uses Crystal Reports 8.  Recently we started seeing some very weird behavior where when printing a bunch of documents in a row, at some point in the process Crystal would freeze on the “Printing Records” window and just give us a nice white screen.  At this point the only thing to do is kill the process and start over.  Considering the number of documents being printed could range up to 150 or so, and it would freeze after anywhere from 1 to 50 documents, it was rather annoying to kill the program, load it back up, continue printing, repeat ad nauseam.

I dove into the problem and read a lot on how this version of Crystal could give you white screens while in the Visual Studio IDE due to some circular dependencies in the dlls.  I found no problem with that, but kept poking along that line.  We started to realize the problem was only happening on newer machines.  So we had the thought that maybe if we just slowed the processing down it would relieve whatever tensions existed.  So I put in a little sleep time between each document.  That just made the whole thing much slower to get through, and didn’t help the freezing problem at all.

After some recoding and improvement of the process, with no real gains on the freezing front, I was searching for possible differences in the machines that froze versus those that didn’t.  Somehow between the number of articles I’ve read recently on concurrency and threading and the old machines vs. new machines ideas bouncing around in my head, I decided to check how many processors each machine had.  It seemed to me that the problem computers were all newer, dual core processors, while the funcitoning ones (my ancient laptop included) were single core.  There was even an older ex-server unit functioning as someone’s desktop that had two separate processors in it and that one froze up on us too.  So I thought maybe Crystal didn’t handle two processors well.  I tried to set affinity for our application to just a single processor.  That didn’t fix the issue unfortunately.  I was set to take this thing all the way though, so I grabbed one of our test machines and disabled the second core in the BIOS.  I ran the printing process and sure enough, it made it all the way through without freezing once.

Now, this isn’t the best way to get around this problem I’m sure, since who really wants to lose half (or some percentage at least) of their processing power?  But, this problem has really taken it out of me, so searching for a better solution just isn’t in me right now.  For now, it’s disable one core and let them print to their hearts desire.  Any better ideas?