OutOfMemoryError - happens after several days

I keep getting the OutOfMemoryError after running a rather large java program over and over for several days. The program has sql statements and creates output files. We stop the program every night for sure along with stopping it a few times in the day. So why would the pc run out of memory after this has ran several times? I thought if the java program was completely stopped all of the memory would be freed up. What can I do to fix this problem?

There are actually 5 copies of the script running from
different copied directories and running
simultaneously in scheduled tasks to keep them
re-running after each one finishes. Over time they
seem to eat up the machines memory and get to a point
where none of them will run anymore. Then we have to
reboot the pc. The script outputs to a text file and
updates the database but does not load in from the
text file.Again, I feel like I'm missing something...Java is usually not considered a scripting language, unless we're talking JavaScript, but I doubt you are. Assuming you mean that 5 Java programs are running simultaneously, am I correct in saying that the JVM, or JVM's if each has it's own, never exits? That's what it sounds like, at least.
That said, you either have a memory leak (as everyone has already suggested), or you actually don't have enough memory to sustain all 5 Java programs at full capacity. If each program runs in it's own JVM and has a max heap size of 128MB and you only have 512MB on the box, it may take some time for the JVM's to allocate all 128MB for each process and cause the exceptions. JVM's allocate heap space on-demand, up to a maximum size, so you wouldn't see the problems when the programs first start.
Either way, you'll need to cut back the amount of heap space the programs take, using the suggestions already posted. Sorry to drag on, but memory leaks aren't always the (only) source of memory problems.
That's my 4cents. Good luck

Similar Messages

  • Data lost after several days running!

    data lost after several days running
    ENV:
    Service Pack 1 for Crystal Reports for Eclipse 2.0
    Tomcat5.5
    Problem:
    There is no problem to export the report as PDF files in the first few days after i upgraded the CR4E.
    But after several days running,the problem appeared : the exported PDF file was incomplete!
    It's supposed to 3 pages,but only 1 page(the first page) exported actually.
    When i restarted the tomcat,the problem disappeared.In several days running,
    the problem appeared again...
    Code:
    reportClientDoc = new ReportClientDocument();
    reportClientDoc.open(Messages.getString("tmpltPath")+tmplt_name, OpenReportOptions._discardSavedData);     
    RptHelp  rptHelp = new RptHelp();
    rptHelp.setDatabaseCtrl(reportClientDoc);
    rptHelp.addDiscreteParameterValue(reportClientDoc,"","userName","admin");
    rptHelp.addDiscreteParameterValue(reportClientDoc,"","start_date",start_date);
    rptHelp.addDiscreteParameterValue(reportClientDoc,"","end_date",end_date);
    for(int i=0;i<6;i++){
         if(!p_name<i>.equals("")){
              rptHelp.addDiscreteParameterValue(reportClientDoc,"",p_name<i>,p_value<i>);
    String exportPath = Messages.getString("reportExportPath");
    String exportName = "test";
    rptHelp.export(reportClientDoc, exportPath+exportName, file_extention);
    File file = new File(exportPathexportName"."+file_extention);
    FileInputStream in = new FileInputStream(file);
    int len = (int)file.length();
    byte[] data = new byte[len];
    int read = 0;
    while (read <len) {
        read += in.read(data, read, len-read);
    in.close();
    response.setContentType("application/x-msdownload");
    response.setHeader("Content-Disposition", "attachment; filename="+ URLEncoder.encode(exportName"."file_extention,"ISO-8859-1"));
    OutputStream ops = response.getOutputStream();
    ops.write(data);
    ops.flush();
    ops.close();
    out.clear();
    out = pageContext.pushBody();

    What is the data? What is displaying the data (graph or chart)? What does your code look like? Why did you post a 4M image to the forum?
    NaN in the data will appear as gaps in plots.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • VI causes high CPU load after several days of running

    Hello,
    I have a strange problem. I have craeted a test bench control VI and it runs on five PCs, controling five test benches. All PCs have almost the same hardware, same motherboard, same CPU, etc.
    Normaly the CPU load is around 50% when I run the VI, but at one PC the CPU load climbs up to 85% after several days (maybe one week) of continuous running and the PC is almost tied up - the VI execution becomes very slow (10 times slower) and the mouse only moves very slowly.
    First I thought that the PC has a problem but the problem dissapears as soon as I stop and restart the VI!
    I don't even have to terminate LabVIEW - only my VI and then everything is okay again.
    The problem does not seem to occur at the other four PCs, but I can not tell for sure.
    The task manager says only LabVIEW causes the CPU load - swap file utilisation is little.
    Is there a way to analyze what causes the high CPU load?
    I Use LabVIEW 7.1 professional
    Operating System: Win XP (SP 2 or 3 I don't remember)
    P.S. I have no loops without wait-functions.
    Greetings Johannes
    Using LabVIEW 7.1 and 2009 recently
    Solved!
    Go to Solution.

    Do all PCs have the same amount of RAM?
    What is the memory use over time as seen by the windows taks manager. Does it increase gradually?
    An increase in resource usage if often cause by sloppy programming.
    Do you grow arrays forever or constantly resize arrays in memory? (built array, insert into array, delete from array)
    Do you often create new references and never close them?
    What does the program actually do? In my opinion, a constant 50% CPU load seems too high for my taste. It means it would not even be able to keep up on slightly older hardware.
    LabVIEW Champion . Do more with less code and in less time .

  • When I want to put a bookmark in my favourites, my browserwheel want turn arouund and around for half a minute. This was happened after several updates. Do you have a solution ?

    When I want to put a bookmark in my favourites, my browserwheel want turn arouund and around for half a minute. This was happened after several updates. Do you have a solution ? it is a very disturbing thing.

    Don't you have a deadline?
    Oh, sorry, I thought this was an URGENT query because you have clients waiting.
    Keep calm, carry on.

  • SharePoint publishing website runs wrong after several days, but return correct after reset IIS

    SharePoint publishing website runs wrong after several days, but return correct after IISReset.
    I have a custom solution on this publishing site, which looks up sharepoint resources, I've changed 
    "List View Lookup Threshold" up to 50 in resource throttling, but this keep occurs sometimes.
    could you give me some clue to solve this permanently?
    Thanks very much in advance!
    ~Rosone

    I am sure you are using BLOB cache. Try to disable it and check. I have seen this issue with BLOB cache.
    Do we see some error in ULS logs and Event viewer
    Use fiddler and check if there is something like 404.
    Try below tool on your code
    https://spdisposecheck2012.codeplex.com/
    If this helped you resolve your issue, please mark it Answered

  • My book package validated, and delivered, but after several days, I have not been notified that Apple has it, or that it is in the iBooks store. When can I expect to hear something?

    My book package validated, and delivered, but after several days, I have not been notified that Apple has it, or that it is in the iBooks store. When can I expect to hear something?

    Did you check in iTunes Producer if your package really imported correctly?
    While in iTunes Producer, you go to "File" and then click on "Package History", it will fetch the status on the Apple system on-line.
    I have the same problem since I have been trying to update my previsously published book, I keep getting import error messages. I tried omitting the version number and "whats new in this version" but nothing seems to work... Sent emails to Apple through the iTunes producer tool but to no avail - so far.

  • Firefox on Mac OS X gets spinning wheel after several days of use

    I have the latest version of Firefox, 8.0.1 and Mac OS X. After running Firefox for several days to a week or more, Firefox starts to become really slow and I would get the spinning wheel for a few seconds when I click a link or click on a field box. Then I have to reboot my computer and it is fixed for another week or so and the spinning wheel starts up again.

    What is the memory usage of Firefox when this happens?
    You can check the on the about:memory page via the location bar.<br />
    That page also has a button ant the bottom to reduce the memory usage.

  • WRT350N, Loses Internet Connection after several days of working.

    My WRT350N worked fine for 4 days after instalation then stoped communicating with my Linksys modem.  I returned my first WRT350N to Best Buy after a day of troubleshooting, and several calls to Comcast, my cable  provider.. Assuming I had a bad router I got a replacement, and after 3 days the replacement router did the same thing, losing its internet connection.  I found it pecular that I could connect to the router. it looked like it was connected to the modem, but would not make an internet connection, even after restarting my Linksys BEFCMU10 Cable Modem and router several times.   I could only make a connection if I pluged my computer directly into the modem.  I also check for firmware updates and at the time there were no firmware updates.I returned my second WRT350N to Best Buy requesting a refund and re-installed my original WRT54GS.  Does the latest version of firmware resolve this specific problem?  Judging by the inquires on this forum, it would appear that alot of users are experenceing this same problem.  I really like the Idea of the Storage Link, but I think I will wait till they work out there problems with the WRT350N, before I buy another Linksys product.

    I suffer from the exact same problem you describe ever since I bought my WRT350N 3 weeks ago. I do not have a solution for you unfortunately. Maybe if everyone with a WRT350N with this problem chimes in here, Linksys will take note.

  • OutOfMemoryError  PermGen - After Several Redeploys

    Hi-
    We get an "OutOfMemoryError PermGen" error after several redeploys on 10.1.3 OC4J (full install w/ ias on Linux, Java 1.5). We don't have any special memory config, other then to specify a max size of 2G.
    The thing is, we have always had this error from release to release, platform to platform. It seems like there is a limited number of times you can redeploy before you run out of memory. Is it possible that redeploying causes a classloader to hold on to class instances, even after that application is removed or redeployed over?
    Have others seen this issue? Is there a workaround? I'm sure we could somehow specify a larger then default PermGen space, but it seems like given the behavior, wouldn't any PermGen space be filled?
    Thanks for your help and suggestions.

    Eeverman:
    As far as I know, oracle oc4j team have been addressing this problem of PermGen memory leak with redeployment or restarting of applications. This problem is indeed not easy to do away with. I would suggest that you file an oracle support tar so that it can be formally addressed again, from yet another perspective, your perspective.
    The immediate cause is, of course, somewhere a reachable object is still holding a strong reference to an object of a class loaded by the discarded classloaders even after undeployment of an application, preventing garbage collection of the class and its classloader.

  • Finder doesn't show some files after several days of uptime

    It is several days my MacBook Pro is turned on:
    $ uptime
    11:08  up 10 days, 12:02, 2 users, load averages: 1.12 0.80 0.60
    and Finder is starting to behave strange...
    the first thing I noticed is that it doesn't show anymore the contents of application packages (ie. right click on a .app and click Show Contents, shows an empty finder window, like there were no files, but from Terminal I'm able to see contents).
    also some other files are not visible. for instance I just downloaded a file in Safari, but I can't see it in its folder with Finder, but I can see it and open it with Terminal.
    before trying a reboot, what could I do to solve this issue?
    perhaps restart Finder? but what is the correct way of restarting it? killall Finder (or some signal other than SIGTERM)?

    To restart Finder, hold the option key whilst "right-clicking" (or two-fingered tap on a trackpad), on the Finder option in the Dock.
    You will see an option to "relaunch".  Select it, and Finder will restart.

  • IPod won't start after several days with charged battery

    I have had this problem since I bought it a year ago. If I don't use my iPod for a few days, when I try to start it - nothing happens. When I hook it up to my computer, the Apple logo appears on the iPod screen, then everything appears normal. If I disconnect the iPod after the "initialization" period with the Apple logo, I see that the battery actually has charge, and usually plenty of it. It's as if the iPod puts itself into a sleep mode that can only be awoken by a brief power source connection. Is this common? Is there a way to avoid this period of "sleep"? Thanks.

    read the following to understand the various "sleep" states:
    http://docs.info.apple.com/article.html?artnum=60945
    is the battery fully charging, or is it getting a partial charge?
    battery information
    battery questions

  • Remote fails after several days

    I'm running ZFD 3.2, on a Netware 5.1 (sp5) box with eDir 85.27c.
    When I
    import a workstation, it will work perfectly for a few days, but then
    it
    fails to respond to Remote Control. I can still do Chat, and pinging
    the
    agent gives perfect success. When I do attempt to connect it gives
    the
    message:
    The Remote management agent was unable to locate the workstation in
    NDS.
    I can delete the workstation and re-import it, and it will work again,
    but
    fail after a few days time. I applied all the ZenWorks support packs
    to the
    clients and the server, and I am running the latest snap-ins for
    ConsoleOne.
    This server is the master of the replica.
    Any tips would be appreciated. I went through everything on TID
    10013987
    and none of it has fixed the problem. Thanks.

    Running a mixed IP/IPX environment, all on static assigned IPs. We're
    also
    using SLP with a Scoped list.
    "Jared L Jennings" <[email protected]> wrote in
    message
    news:PaY5a.1250$[email protected]..
    > Are you running pure IP?
    > Is your network DHCP?
    >
    > --
    > Jared L Jennings, CNE 5,6
    > Using XanaNews 1.13.2.10

  • What happens after 30-day trial of Indesign CC?

    I just started a 30-day trial of Indesign CC. After the 30 days I'm assuming I will have my desktop CS6 back as usual, yes?

    Should... but read How do I prevent Creative Cloud from taking over my CS6 perpetual license?

  • Desperately need BizSpark help, received no response from support email after several days

    I emailed [email protected] on 02/25 and still have not received a response.  Where can I post questions?  Here is the original email:
    Hello, I recently started working for a new company. My previous company was a BizSpark graduate. I loved the program, so thought I would apply for it again at my new company. I went through the signup process
    using my existing MS account (redacted). At no point did it indicate I was doing anything other than filling out a new application. When I finished, it went to my old bizspark page, but all the company information was changed (except for the logo)! Not only
    is that terrible, because now it appears as though my new company is a BizSpark graduate, but I still want to try to enroll my new company in the program!
    Please advise!
    I have since edited everything except my company name because I cannot find a way to change it.

    Scott, I dont deal directly with the BizSpark program, but I've reached out to a few people internally who I think do.  I'll let you know what I hear back, and maybe we can get your email replied to.
    Thanks,
    Mike
    MSDN and TechNet Subscriptions Support
    Did Microsoft call you out of the blue about your computer?
    No, they didn't.

  • Movie rentals disappear several days after transferring to iPad.

    I'm having a repeating problem where I rent iTunes movies on my laptop and then transfer them to my iPad but the movies disappear from the iPad after several days. They do not reappear on my laptop, nor do they show as expired. They are literally just gone without warning. This is always inside the 30 day rental period and without opening them. I'm aware of the 24-hour rule and that is not the problem. They literally just vanish.
    iTunes customer service has been good about restoring credits to my account for missing movies, but they are clueless as to why it is happening. I am running the latest OS versions on my laptop (mid 2012 Mac Book Pro) and iPad 2. Everything is up to date.
    The first time this happened it was curiousity; now that it's happened multiple times I am DONE with iTunes rentals until there is a solution. The tipping point was when the customer service person emailed me and suggested I use the fee-based support system to work directly with an Apple tech specialist.
    Really? Are you suggesting that I should PAY YOU to fix a broken system just so to once again have the opportunity to PAY YOU to watch movies? I don't think so...
    I'm a die hard Apple user/owner but the suggestion that I pay them to find a software bug...just so I then can give them more money (in the form of rentals)...ridiculous. That's what's called "adding insult to injury."
    I really would like to see this resolved, but I'm switching to Amazon rentals in the mean time.
    Has anyone else experienced a similar issue?

    When I go to this screen it says the movie is on the right side. I apply the changes. After the sync, it says it is on the Ipad. However it is not on the ipad. I've had the Ipad2 since it came out. THis is the first time this has happened.
    The Django Unchained Movie being stuck on the Ipad without seeing it on the ipad is old news. I thought I got it off. It's still on there.

Maybe you are looking for

  • How do i connect my windows vista laptop to iPhone personal hotspot? Will it still work if my laptop doesnt have iTunes installed?

    I am currently using iPhone 4 and windows vista laptop. i cant seem to get my windows vista laptop to connect to the personal hotspot on my iPhone using USB. Is it because iTunes is not installed in my windows vista laptop? I have tried it on a MacBo

  • Problematic iBook needs to be repaired AGAIN!

    I have 12 inch 1GhZ G4 iBook. I bought it in May of 2004, and since then, it has had its logic board repaired twice within the last year. The problem is that the display stops working. I hear the fan, but the screen remains blank. I was told the logi

  • _root level methods failing when using movieClipLoader

    man wouldn't have a clue why, using onloadInit BELOW, doesn't listen to simple button methods addressed to the _root movieClip, the script for this frame on the root mc is below, any help please It works fine offline, but when on server the button re

  • "Update All" Stuck -- Solved!

    No, you can't cancel it.  But you CAN make it work instead of waiting for three days and having it still not complete. My iPad was trying to update 200 apps (I collect a lot of free stuff I never use, so sue me).  Can't cancel.  Can't even delete 'em

  • RectVisible function not working as before on Windows 8

    What I want to achieve (and did successfully before switching to win8.1) is to check whether the currently displayed windows (i.e. not minimized)  visible parts (to the user) are crossing a selection rectangle I manages. For that purpose I used to us