|
|
Why do you have to use LINQ ?
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
hi,
business requirement.
thanks
|
|
|
|
|
There is a LINQ forum
only two letters away from being an asset
|
|
|
|
|
Hello everybody,
I have a problem to which I haven't been able to find an answer through Google. I am making a windows service that reads image files in an input folder and then profiles the document in a document management system. The program can't manipulate images itself so it's OCR and Barcode reading, and image splitting, converting and combining functions are performed in separate applications using the System.Diagnostics.Process class.
The problem I am running into is that when I call my TiffSplitter app I get a System.OutOfMemoryException when I the image is first loaded into the program. In initial testing I found that I could set the "Allow service to interact with desktop" property of the service and it would run on my development PC but this quick fix didn't solve the problem on a client site.
I know that setting that property isn't a proper solution either so I'm open to ideas as to how to properly fix this. The reason this program is a service is so that it will auto start on system startup and doesn't require a windows user to log on to windows to start working. Is there any way of increasing the amount of memory that a process can use? Or is there some other solution that I'm missing?
Here some info about The PC's and the Program:
Development PC-
OS: WIN XP with SP2
Pentium 4 2.80GHz
2GB Ram
Client Server-
OS: WIN Server 2003
Runs on a virtual machine
TiffSplitter app-
vb6 app
Uses Imaging Pro to split and OCR Tiffs
Program loads fine but errors out on the image loading functions
Service app-
C# 2.0 app
Uses following code [Paraphrased] to open TiffSpliter:
using (Process p = new Process())
{
p.StartInfo.CreateNoWindow = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.Arguments = [args];
p.StartInfo.FileName = [exe];
p.Start();
p.WaitForExit();
p.Close();
}
modified on Friday, October 30, 2009 6:35 PM
|
|
|
|
|
Hi,
Fallout_Monkey wrote: I get a System.OutOfMemoryException
When we loop through some thing with out an End, we usually get this error.
So please check all your methods, or just create a log files for each method,
and identify is there any loop goes on.
Because your tiny program will have the sufficient memory untill some thing goes wrong.
(i have not given the solution, just its my observation on your post)
|
|
|
|
|
Thank you for your reply.
There is no infinite loop as your proposing. I know this because the exact same code will run on in a console app on the desktop with the same input. Also the line of code that throws the error is not in a loop.
|
|
|
|
|
If you're processing TIFF files, make sure your VB6 app isn't trying to display the image. GDI and GDI+ do not support JPEG compressed TIFF images, so this could be the cause of your problem. I'm not familiar with the library you're using so I cannot comment on the reliability of it.
|
|
|
|
|
Thank you for your reply.
The fact that it is a tiff has no bearing on this situation because I am not using GDI. I am using a third party control that is rendering and OCRing the image.
|
|
|
|
|
...and if that third-party control is using GDI...??
|
|
|
|
|
As you said GDI doesn't handle tiff images and this this control does so it is probably safe to say that it uses some other proprietary library to do this. Regardless, the fact remains that this error occurs on my development box only when I run it as a service without access to the desktop. When I run it as a console app or give it access to the desktop it runs fine. Also the service does call another app to combine tiffs. This second app uses a library written in .net 2.0 and itself uses GDI+ and the app runs fine in all the situations I have mentioned whereas the vb6 app doesn't when it is run from a service(with or without desktop access on the client server).
modified on Wednesday, October 28, 2009 11:15 AM
|
|
|
|
|
Fallout_Monkey wrote: GDI doesn't handle tiff images
No, I said GDI/GDI+ can't handle JPEG (LZW) compressed TIFFs. Uncompressed and other format TIFFs are not a problem.
If it works on one machine and not another, I'd start by following the references using Dependency Walker and make sure all references resolve on the machine it breaks on.
|
|
|
|
|
Forget different machines for a second. I don't know why it works on the same machine(the client server) from a console app but gets the out of memory exception when running from a service and the error is occurring in a separate app which doesn't change between the two versions of the parent app. I don't think it's a dependency issue. I mean if I was calling a vbscript with everything the same and the script ran from the console app but not from the service, would you be saying the check the dependencies?
|
|
|
|
|
Well, there's a bunch that changes between a console app, a service, and a normal Windows app. Apartment models, message pumps, execution environment, ... The dependancies DO change depending on if the app is a console or a Windows forms app.
If you really want to get to it, I'd probably contact whoever wrote the controls/classes your app is using and see if those controls/classes have been tested in Console and Service apps and if they have threading apartment model restrictions.
Any "normal" code doesn't really change between the different app types, but the framework around your app does and so do the requirements of third party components.
Fallout_Monkey wrote: I mean if I was calling a vbscript with everything the same and the script ran from the console app but not from the service, would you be saying the check the dependencies?
Not exactly a good example since the script runs in a completely seperate (and consistent) execution environment.
|
|
|
|
|
I apologize I'm an idiot. I didn't read my logs correctly and have found that the out memory error occurs on the desktop app as well. But it is sporadically. It will process a whole bunch and start getting the error for the next bunch of images. And I can rerun some of the ones that fail and they work. Could it be that the VB6 app is just not cleaning up properly when I shut it down?
|
|
|
|
|
The VB6 runtime cannot clean up what it did not allocate. If you've got a leaky library that the app is using, then yeah, you can run into a problem like this.
|
|
|
|
|
Hi guyz,,,,,
I am going to develop a remote PC control software as a part of my project work in C#.Net ...... Plz tell me some of your valuable suggestions on this topic......or any new features which has to be introduced .....
|
|
|
|
|
Homework is for you to do, try doing some research into your subject instead of asking to be spoon fed.
|
|
|
|
|
HEY!!!! i HV COLLCTD a lot of requirement........but I am looking for a new feature........different from existing ones
|
|
|
|
|
Hi,
Just have a look at the features of Team Veawer for your ref.
|
|
|
|
|
Is it possible in C#: I want to monitor the file system for when a specific file is deleted from the Firefox cache folder. I've tried using Process Monitor but it has a bug when writing out its logs to disk making it useless.
FileSystemWatcher seems interesting but I *need* to be able to identify the process which caused the deletion.
How can i achieve file system monitoring AND identify the process which has removed / modified a specific file on my WIndows XP system
I am open to a shareware solution
|
|
|
|
|
Hi,
Try with API Hooking.
It works Perfect.
|
|
|
|
|
The FSW will not tell you who deleted the file, nor the process that did it. Truthfully, NTFS does not track such information, so there really isn't any API call you can use to do this.
As terse as the first replier's post was, he is essentially correct. You have to intercept the I/O calls to the kernel deleting the file. The problem is you can't write that intercept layer in C#, or anny managed language. The only supportable solution would be to write it in C++. Though, for something like this, you've going to have a hell of a time finding people with experience doing such a thing.
|
|
|
|
|
Hi,
I have to devleop a application which will monitor a database for new jobs. As soon as a new job is created, engine will pick up the job and process it. Engine will be multi threaded so it can process multiple jobs simultaneously. This will be my first application to use threading so I have couple of confusions:
1. Engine will be running on 4 machine simultaneously so how do I make sure only one engine picksup a job at any one time.
2. In case one engine crashes, How do I restart the jobs for that engine using another engine.
3. How can I monitor the health of each engine.
Any help with the database and engine design is appreciated.
|
|
|
|
|
You may get a better response in the Design and Architecture forum.
1 Implement some logging/flagging system indicating the status of the job and who is doing the work
2 Make you logging/flagging time sensitive (use a timestamp) and have another process monitor the job processing
3 Design you engine to publish its state periodically and have 2 monitor it.
Anything more than general statements like the above are going to require more detail and that is your job after all.
|
|
|
|