OutOfMemory on weblogic server 2005-01-07 - By Kevin Gaasch
Back Well, if it's being kicked off by the scheduler and not an actual client, then the response time isn't really an issue, so neither is asynchronous processing.
My guess is that you're still having memory problems. Even though you may not be maxing out the heap with the new parameters, you could be thrashing the box. I would watch the memory on the server while the process is running. If it's Windows, watch the task manager, if it's linux, use top. If the server is using too much virtual memory, it's going to be spending too much time swapping pages in and out of the virtual memory block and not allocating any CPU cycles to actually processing the data. Plus, the server itself needs a good cushion of memory just to handle it's own housekeeping.
If it does turn out to still be a memory problem, you should look at ways to optimize that particular segment of code. Process the data in small, managable chunks. For example, if the file is in some sort of record format, process one record at a time. Read one record of data from the database (or however you're getting it), format it, and write it to the stream.
Also, re-use your objects as much as possible, so that the garabage collector is not spending a lot of time and CPU reclaiming memory. And bump your timeout to some insane value like 30 minutes. That will give you time to monitor the process and the server to really get an idea of what's going on. Plus, if you break the processing into chunks, you can record the time each piece of data takes to process and use that to plan for future files sizes. If the size of the file gets bigger, you need to know, so you can predict how long your processing time is. That will help you indentify a runaway thread.
Kevin E. Gaasch Panhandle Plains Student Loan Center Software Craftsman Senior Programmer/Analyst Sun Certified Java Programmer Work: 806.324.4108 Cell: 806.674.1523
>>> sanjeevkoppal@(protected) 1/6/2005 10:55:53 PM >>> Hi, Our application is huge and the client side is Swing UI, We are using JWS to launch the application. And the backend in sybase. This is happening in all platforms, Developement and as well as in Production.... We are using Connection pool as "David " had pointed out it is infact 'ms' for the first argument in JAVA_OPTIONS "-server -ms512m -mx1024m" How do i monitor how long its taking to write? We have set the transaction time-out to 240 seconds,after which the server doesn't repond, it just throws and exception saying "No response after "240" seconds". Please let me know how can i run it in a different thread. We also use Quartz scheduler which is different process, do you think this would work if we do it on quartz sceduler..
let me know your suggestions and opinions...
regards Sanjeev
Kevin Gaasch <keving@(protected)> wrote: I would agree with David on this one. A client request should return in a timely manner. Hence, you would want that kind of processing done on a separate thread.
One other suggestion I have is to set you minimum heap (ms) equal to your maximum heap. That way the server doesn't have to burn CPU cycles trying to allocate memory.
You should also consider refactoring the way you're building the file. I would bet that your memory problems are not caused by the size of the file, but how you're creating it. For example, if you build the entire file as a string in memory, that would eat a significantly larger amount of memory than writing the file to the stream in chunks. Remember that if you're running in a multi-user environment, there will be other clients trying to use the system. You don't want to "nail the server to the wall" for just one process.
As for your timeout problem, you can adjust the timeout length in the JTA settings on the weblogic console.
Kevin E. Gaasch Panhandle Plains Student Loan Center Software Craftsman Senior Programmer/Analyst Sun Certified Java Programmer Work: 806.324.4108 Cell: 806.674.1523
>>> david.karr@(protected) 1/6/2005 11:07:26 AM >>> Are those the exact arguments you're sending on the command line? I'm not sure what that would do, as you're specifying "-mx" twice. You probably meant the first one to be "-ms". In any case, I imagine that would still set "-mx" to 1024, but that's just a guess.
Are you monitoring how long it really takes to write the data to the file? Is it really taking on the order of >240 seconds? If so, then you should probably do that on a separate thread, asynchronously from the original client request.
-- --Original Message-- --
CONFIDENTIALITY NOTICE The information contained in this message and/ or its attachments may be privileged and confidential, and is intended only for the use of the individual (s) named above. If you are not the intended recipient, you are notified that any dissemination, distribution, or copying of this communication is strictly prohibited and are requested to delete the message and/or its attachments. If you have received this communication in error please notify us immediately by telephone at (806) 324-4100. Panhandle-Plains Student Loan Center (PPSLC), has taken reasonable precautions to ensure that any attachment to this e-mail has been scanned for viruses. We specifically disclaim all liability and will accept no responsibility for any damage sustained as a result of software viruses. We advise you to carry out your own virus checks before opening any attachment.
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
|
|