Memory Leak in web application created using j2ee

Hi,
Our company has one web application, provided by "X" vendor. this application has many JSPs and many TLDs used. The basic behaviour of the apoplication is to connect to the database (Oracle) get the information and show it to the user.
We deployed this web application in Tomcat 5.0.25 in the windows environment. One thing we observed here is, when we login to the application the tomcat5.exe process increses its memory. and when we logout, it does not come down to the original position. similar things happen when we search for some of the data using there provided searches.
We have some code developed which uses httpclient to login to this web application (created for performace testing). This code initially logs in 50 users which goes fine, then logs in 100 users which also goes fine but after this 100 users we ran the code for 50 users agian but this time it threw OutOfmemory exception:Java heap space error.
we are observing the memory in the Task Manager in windows.
Can anyone tell me what could be the cause of this? is it the web application causing problem or is tomcat caching some pages into the memory and is not releasing them?

Hi,
Few questions!
1> Have you tweaked your jvm?
2> What are the values given for Xms and Xmx?
3> What is the size of XX:MaxPermGen?
4> How much RAM is available on the system where you have deployed your app?
5> Are you using pre-complied JSPs for faster response?
6> Which JDK are you using?
7> Have you tried using latest version of Tomcat?
8> If these doesnt help, use any profiler to find the leak. <JProfiler, JVMTI, YourKit profiler etc>
I hope answering these questions would help you :)
njoy!

Similar Messages

  • Memory leaks in my application

    Hi all,
    My application is running well but the memory used by my application is not properly released. If my application is kept running for a day ..then the total system memory is used and server got struckup. can any body help me how can trace for the memory leaks in my application.
    Thanks in advance.
    Santhosh.gandhe

    What version of JDK are you running?
    The Java compiler leaks memory each time a class is compiled. Web applications containing hundreds of JSP files may as a result trigger out of memory errors once a significant number of pages have been accessed. The memory can only be freed by stopping Tomcat and then restarting it.
    The JSP command line compiler (JSPC) can also be used to recompile the JSPs.
    Note: This issue has been fixed in Sun JDK 1.4.x.

  • Memory leak in c++ application

    This one line of code is creating a memory leak in my application and I'm not sure what to do after this statement to prevent this from happening.
    Here's the line of code:
    oracle::occi::PObject * pObject = m_statement->getObject( 3 );

    This forum is for general programming questions, and for questions about Studio.
    Questions specifically about OCCI are more likely to get a helpful answer in the OCCI forum:
    C++ Call Interface (OCCI)
    (You can find this and other data-base related forums at forums.oracle.com, then expand the Oracle Database item, then click "more".)

  • Exception when trying to run an Web Application that uses a Web service

    Hello All,
    I get an exception when trying to run an Web Application that uses a Web service. The web application is a WebDynpro Application.(an application similar to the one "Using an Email Web Service in Web Dynpro" in the tutorial section of Web Dynpro but using a different web service)
    The exception is
    <b>Service call exception; nested exception is: com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (404) Not Found.</b>
    Could anyone give me an idea on what might be the problem ?
    Regards,
    Loveline.

    Hello,
    Like you said it was the problem with url.
    The webservice I used is actually running on the local machine (where the NetWeaver developer studio is installed); so in the url I had specified localhost. But I deployed the application on another server(SAP J2EE Engine). That is why it didn't work. On changing the url as required, the application is working fine.
    Thanks !
    Regards,
    Loveline.

  • How to get web application to use Tuscany without conflicting with SAP SDO

    Hi,
    We are attempting to run a web application on SAP NetWeaver CE 7.1 SP1 which uses Tuscany SDO.  As it now stands We must use Tuscany because the web application will not run with the SAP SDO implementation provided by Netweaver. To ensure that Tuscany is loaded with priority, we have packaged the Tuscany JAR files and their dependencies as a heavy resource, as described here:
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/60642a88-95fe-2b10-d387-a245d48fc257?overridelayout=true
    The final check showed that Tuscany was correctly deployed as a heavy resource and included the following JAR files:
    common-2.2.3.jar
    ecore-2.2.3.jar
    ecore-change-2.2.3.jar
    ecore-xmi-2.2.3.jar
    tuscany-sdo-impl-1.1.1.jar
    tuscany-sdo-lib-1.1.1.jar
    tuscany-sdo-tools-1.1.1.jar
    xsd-2.2.3.jar
    We also verified that the web application using Tuscany has a hard reference to the Tuscany heavy resource.
    However, when we try to run the web application, the following error is logged:  java.lang.LinkageError: Class commonj/sdo/DataGraph violates loader constraints
    The issue is definitely due to some kind of classloading conflict with the SAP SDO library, as the application runs normally when SAP SDO is manually removed from the classpath. Doing this on a production system is unfortunately not an option, though.
    So the question is: how to get web application to use Tuscany without conflicting with SAP SDO?

    I took a look at the "printerReady" example.  Looks like I may be able to use the InetPing (...) function to ping through a range of IP addresses looking for a response.
    Any ideas on how to find the MAC address associated with the IP addresses that respond?
    We may have multiple units responding and the MAC address will allow the operator to determing which unit to connect to.
    I'll try the InetPing to see how it works,
    Kirk

  • How to capture memory usage for web application

    In OATS openscripts, how to capture memory usage for web application? Does it have the exisitng java method that we can call to get the memory data (e.g. peak bytes, private bytes) consumed by web application?

    JProbe

  • How i can make web application by using oracle form6i

    how i can make web application by using oracle form 6i , indetail .
    A.R

    indetail .As Andy Millman might observe, you're having a laugh. This is a big topic, far exceeding what it is reasonable to expect people to help out with in a Forum. Do you not have the 6i documentation?
    OTN has a site for upgarding to web forms. Although it is mainly focussed on moving to 9i/10g a lot of the issues and solutions apply to moving a 6i client/server app to web deployment. For further help there is a Forms.
    Cheers, APC

  • List of .jar file need to add in web application by using eclipse europa?

    hi
    what are the list of .jar file need to be added in web application which use the ide of Eclipse Europa?

    Depends on the application requirements. For a basic JSP/Servlet application just integrate Tomcat in Eclipse and assign it as application server to your web project, then you don't need to add anything. If you for example need JSF, then you should add its JAR's to the classpath of the web project, which is by default /WEB-INF/lib.

  • Web Page created using the Site Studio loads slow.

    Web Page created using the Site Studio loads slow, where we hard coded the program to fetch the data from the database.
    Please tell me any other way to write the program so that it takes less time to load the site.

    Hello Marcus,
    I didt the same what you have explained. I followed the following Steps.
    1. Created the Web Page and published(It is in Umlock State).
    2. Created the Site Navigation and gave the target for that page.
    3. In the Portal Content, I created a role , then folder and for the folder property, i gave the External Connector wpcnavigation:///wpccontent/Sites/News/Site Navigation/navigation.wpc ( Say for ex News is a Site) and Entry Point as Yes.
    4. After this i assigned that role to a user(Super Admin).
    After doing the above steps, I couldnt able to see the Web Page displayed.
    Thanks
    Gopi

  • How to create reports from my existing web application on Java/J2EE with Oracle Client 10g as the backend?? Help sought for

    Our company has developed an  Web Application and we are also looking out for the development of reports using Business Objects Exterprise XI Release 2 and for this purporse I do require some help from the forum who can literally show me how to get on and working on creating the reports.

    Thats why I thought I should make the following chain in the keystore, possibly in this order.
    1. My private key (simply generated in the server)
    2. Import Root certificates from NS
    3. Import Trusted certificate issued by NS
    Then when I sign with my private key surely an association will be formed to the trusted authority certificate. The problem I'm having is when I first made my private key I used openSSL as it was only intended for HTTPS. Now I need to create a keystore so I can use jarsigner to sign the jar file, and I can't see how to create a keystore using my existing private key. Surely if I created a new key and self sign, then import the trusted certificate the association will fail, as the private key will not be the same 1 that I used to make the CSR when applying for the trusted certificate.

  • Java Memory Monitoring in Web Application

    Hi All,
    Request you to please review the below mentioned suggestion and provide inputs:
    Over the years, I have been involved in some projects involving web development in J2ee. JAVA memory usage is an issue that is common amongst all.
    Following are some of the questions that come across to a developer regarding the JAVA memory:
    Memory Usage Statistics.
    Trending of Memory statistics.
    Memory Leak.
    Performance optimization in case memory leaks occur.
    When it comes to answering the above, the most common suggestion is to enable heap dumps and analyze it using a heap analyzer tool. However, there are times and projects where these options are not approved off and developer is always asked to review code again and again. This is again a frustrating option for someone who has just joined a maintenance project and reading through code is not a feasible option. It has happened to me and I did the following to solve some of my problems and eventually all.
    Instead of analyzing heap dumps, I decided to do the following:
    Add a request filter to my J2EE application.
    Add following log statements in the filter:
    URL fired.
    Runtime.getRuntime().freeMemory()
    Runtime.getRuntime().totalMemory()
    Runtime.getRuntime().maxMemory()
    Gather data from daily app usage and build some trending statistics.
    Not only were we able to decide an optimum memory setting for our server, we were able to detect leaks as well. However, i agree detecting leaks wasn't as simple as it's with other tools considering the debugging effort that's involved.It is not a conventional approach but come sin handy when projects don't want to involve costs and maintain equilibrium at production systems as well.

    Hi,
    Few questions!
    1> Have you tweaked your jvm?
    2> What are the values given for Xms and Xmx?
    3> What is the size of XX:MaxPermGen?
    4> How much RAM is available on the system where you have deployed your app?
    5> Are you using pre-complied JSPs for faster response?
    6> Which JDK are you using?
    7> Have you tried using latest version of Tomcat?
    8> If these doesnt help, use any profiler to find the leak. <JProfiler, JVMTI, YourKit profiler etc>
    I hope answering these questions would help you :)
    njoy!

  • Memory leak under GNU/Linux when using exec()

    Hi,
    We detected that our application was taking all the free memory of the computer when we were using intensively and periodically the method exec() to execute some commands of the OS. The OS of the computer is a GNU/Linux based OS.
    So, in order to do some monitoring we decided to wrote a simple program that called exec() infinite number of times, and using the profiler tool of Netbeans we saw a memory leak in the program because the number of surviving generations increased during all the execution time. The classes that have more surviving generations are java.lang.ref.Finalizer, java.io.FileDescriptor and byte[].
    We also decided to test this simple program using Windows, and in that OS we saw that the memory leak disappeared: the number of surviving generations was almost stable.
    I attach you the code of the program.
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    public class testExec
        public static void main(String args[]) throws IOException, InterruptedException
            Runtime runtime = Runtime.getRuntime();
            while (true)
                Process process = null;
                InputStream is = null;
                InputStreamReader isr = null;
                BufferedReader br = null;
                try
                    process = runtime.exec("ls");
                    //process = runtime.exec("cmd /c dir");
                    is = process.getInputStream();
                    isr = new InputStreamReader(is);
                    br = new BufferedReader(isr);
                    String line;
                    while ((line = br.readLine()) != null)
                        System.out.println(line);
                finally
                    process.waitFor();
                    if (is != null)
                        is.close();
                    if (isr != null)
                        isr.close();
                    if (br != null)
                        br.close();
                    if (process != null)
                        process.destroy();
    }¿Is anything wrong with the test program we wrote? (we know that is not usual to call infinite times the command ls/dir, but it's just a test)
    ¿Why do we have a memory leak in Linux but not in Windows?
    I will appreciate any help or ideas. Thanks in advance.

    Hi Joby,
    From our last profiling results, we haven't found yet a proper solution. We think that probably the problem is caused by the byte[]'s/FileInputStreams created by the class UNIXProcess that manage the stdin, stdout and stderr streams. It seems that these byte arrays cannot be removed correctly by the garbage collector and they become bigger and bigger, so at the end they took all the memory of the system.
    We downloaded the last version of OpenJDK 6 (build b19) and modified UNIXProcess.java.linux so when we call its method destroy(), we assign to null those streams. We did that because we wanted to indicate to the garbage collector that these objects could be removed, as we saw that the close() methods doesn't do anything on their implementation.
    public void destroy() {
         // There is a risk that pid will be recycled, causing us to
         // kill the wrong process!  So we only terminate processes
         // that appear to still be running.  Even with this check,
         // there is an unavoidable race condition here, but the window
         // is very small, and OSes try hard to not recycle pids too
         // soon, so this is quite safe.
         synchronized (this) {
             if (!hasExited)
              destroyProcess(pid);
            try {
                stdin_stream.close();
                stdout_stream.close();
                stderr_stream.close();
                // LINES WE ADDED
                stdin_stream = null;
                stdout_stream = null;
                stderr_stream = null;
            } catch (IOException e) {
                // ignore
                e.printStackTrace();
        }But this didn't work at all. We saw that we were able to execute for a long time our application and that the free memory of the system wasn't decreasing as before, but we did some profiling with this custom JVM and the test application and we still see more or less the same behaviour: lots of surviving generations, at some point increase of the used heap to the maximum allowed, and finally the crash of the test app.
    So sadly, we still don't have a solution for that problem. You could try to compile OpenJDK 6, modify it, and try it with your program to see if the last version works for you. Compiling OpenJDK 6 in Linux is quite easy: you just have to download the source and the binaries from here and configure your environment with something like this:
    export ANT_HOME=/opt/apache-ant-1.7.1/
    export ALT_BOOTDIR=/usr/lib/jvm/java-6-sun
    export ALT_OUTPUTDIR=/tmp/openjdk
    export ALT_BINARY_PLUGS_PATH=/opt/openjdk-binary-plugs/
    export ALT_JDK_IMPORT_PATH=/usr/lib/jvm/java-6-sun
    export LD_LIBRARY_PATH=
    export CLASSPATH=
    export JAVA_HOME=
    export LANG=C
    export CC=/usr/bin/gcc-4.3
    export CXX=/usr/bin/g++-4.3Hope it helps Joby :)
    Cheers.

  • Unable to deploy the web application that uses a ejb3.0

    Hi,
    I have created a adf application with Model and a ViewController.
    Locally from jdeveloper I am able to run the application successfully by right clicking the web page and click on Run.
    However, when I try to deploy this application that contains both Model and ViewController, I am getting an error:
    [04:41:52 PM] Weblogic Server Exception: weblogic.application.ModuleException: Could not setup environment
    [04:41:52 PM] Caused by: weblogic.deployment.EnvironmentException: [J2EE:160167]The module QC-ViewController-context-root in application QC_application1 uses ejb-links but no EJB modules were found for this application.
    [04:41:52 PM] See server logs or server console for more details.
    [04:41:52 PM] weblogic.application.ModuleException: Could not setup environment
    [04:41:52 PM] #### Deployment incomplete. ####
    [04:41:52 PM] Remote deployment failed
    Any help on this issue is appreciated.
    Thanks
    Saikrishna

    Hi Saikrishna,
    I had the same problem. My fix was to create a new Deployment Profile (EJB JAR file) in my Model (the default is an "ADF Library JAR file") and have my ViewController depend on that.
    Also, make sure your ejb references in web.xml have the ejb-link attribute:
    <ejb-local-ref>
    <ejb-ref-name>AuditSessionEJB</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>com.incomemax.ejb.session.AuditSessionEJBLocal</local>
    <ejb-link>AuditSessionEJB</ejb-link> <---- this entry
    </ejb-local-ref>
    Hope that helps,
    Chris

  • Web Application by using Tomcat

    I want to create my own application by using servlet, jsp, tomcat.
    I want to create my own context and in the last I want to deploy by using the tomcat.
    I do not want to use the EJB.
    I do not want to use any IDE also.
    I also want to use the war files.
    Please help me how can I start, what are the necessary steps I have to do.

    Hi,
    There is the official J2EE Tutorial for technologies such as Servlets and JSPs. You can download it from Sun.
    If you have already downloaded Apache Tomcat, you can find many web applications examples in its directory.
    You can find lots of information here:
    http://www.coreservlets.com/
    And yes, Google...
    Akos.

  • What is the correct way to set a web application to use HTTP or HTTPS?

    In the past I've always created an HTTP web application as the default zone. Then extended the web app, creating a new IIS website on port 443 and enabled SSL. This seems to have worked fine, but I recently read an article stating that it is not good to
    extend a web app unless absolutely necessary. So can someone tell me what the proper way is to configure a single web application to work with HTTP and HTTPS?

    Extending the web application to support both HTTP and HTTPS is a perfectly good method and in fact is the only way to have a web application support both so what you've done is fine.
    If the web application will only use HTTPS, you can set this up when you first create the web application. Specify port 443 and the SSL option (and ensure the URL has an https://) when creating the web application. You'll need to install the certificate
    in IIS once the web application has been created.
    Jason Warren
    Infrastructure Architect
    Habanero Consulting Group
    habaneroconsulting.com/blog

Maybe you are looking for