7 Replies Latest reply on Jul 22, 2015 7:50 PM by rp0428

    java heap space error when opening a connection

    EdStevens

      SQL Dev 4.0.2 on Win 7 Pro, 64-bit

       

      User has been working with SQL Dev for some time.  Beginning Monday morning, he has this problem.

      SQL Dev starts just fine.

      When he tries to open a connection, it returns  a java heap space error.

      We don't know "what changed".  It was working last week.  We came in yesterday morning to find that all of our workstations had been rebooted over the weekend.  It looks like, from our system change log, that a bunch of security patches may have been rolled out, which certainly looks suspicious, but this one user appears to be the only one with a problem.

       

      Java heap space

      Exception stack tace:

       

      java.lang.OutOfMemoryError: Java heap space

      at java.lang.reflect.Array.newArray(Native Method)

      at java.lang.reflect.Array.newInstance(Array.java:70)

      at oracle.jdbc.driver.BufferCache.get(BufferCache.java:226)

      at oracle.jdbc.driver.PhysicalConnection.getCharBuffer(PhysicalConnection.java:7672)

      at oracle.jdbc.driver.OracleStatement.prepareAccessors(OracleStatement.java:1005)

      at oracle.jdbc.driver.T4CTTIdcb.receiveCommon(T4CTTIdcb.java:277)

      at oracle.jdbc.driver.T4CTTIdcb.receive(T4CTTIdcb.java:146)

      at oracle.jdbc.driver.T4C8Oall.readDCB(T4C8Oall.java:844)

      at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:358)

      at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)

      at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)

      at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:204)

      at oracle.jdbc.driver.T4CCallableStatement.executeForDescribe(T4CCallableStatement.java:877)

      at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1167)

      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1289)

      at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3584)

      at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3628)

      at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1493)

      at oracle.dbtools.db.DBUtil$2.call(DBUtil.java:365)

      at oracle.dbtools.db.DBUtil$2.call(DBUtil.java:353)

      at oracle.dbtools.db.DBUtil.lockForOperation(DBUtil.java:1701)

      at oracle.dbtools.db.DBUtil.executeOracleReturnOneCol(DBUtil.java:374)

      at oracle.dbtools.db.OracleUtil.executeReturnOneCol(OracleUtil.java:328)

      at oracle.dbtools.raptor.utils.DatabaseFeatureRegistry$QueryFeature.isFeatureEnabled(DatabaseFeatureRegistry.java:98)

      at oracle.dbtools.raptor.utils.DatabaseFeatureRegistry.initializeFeatures(DatabaseFeatureRegistry.java:202)

      at oracle.dbtools.raptor.InitializeConnectionListener.initConnection(InitializeConnectionListener.java:194)

      at oracle.dbtools.raptor.InitializeConnectionListener$1.initializeConnection(InitializeConnectionListener.java:52)

      at oracle.dbtools.raptor.utils.Connections.initializeConnection(Connections.java:2027)

      at oracle.dbtools.raptor.utils.Connections.access$100(Connections.java:75)

      at oracle.dbtools.raptor.utils.Connections$ConnectionInfo.getDatabase(Connections.java:224)

      at oracle.dbtools.raptor.utils.Connections.getConnection(Connections.java:1165)

      at oracle.dbtools.raptor.utils.Connections.getConnection(Connections.java:1139)

        • 1. Re: java heap space error when opening a connection
          thatJeffSmith-Oracle

          >>that all of our workstations had been rebooted over the weekend

          so for this user, they are running SQLDev on a PC?

           

          the easiest thing to do would be to add available memory to the JVM by updating the product.conf file

           

          now, why it would need more memory than it did before the wkd update (or why there is less available memory after the update), that I have no idea

          • 2. Re: java heap space error when opening a connection
            EdStevens

            Jeff Smith Sqldev Pm-Oracle wrote:

             

            >>that all of our workstations had been rebooted over the weekend

            so for this user, they are running SQLDev on a PC?

             

            the easiest thing to do would be to add available memory to the JVM by updating the product.conf file

             

            now, why it would need more memory than it did before the wkd update (or why there is less available memory after the update), that I have no idea

            We found product.conf located at C:\Users\estevens\AppData\Roaming\sqldeveloper\1.0.0.0.0

            Changed 'AddVMOption -Xms128m' to 'AddVMOption -Xms256m'. 

            Rebooted.

            No joy.

            I think it also interesting that when he starts SQL Dev, it opens without showing the 'start page'.  It has the navigation panel/connections list on the left, but the area to the right is totally blank.  I don't know if that's another indication of the same root problem, but though it worth mentioning.

             

            If we decide to re-install, is it as simple as deleting the c:\Program Files\sqldeveloper folder?

            • 3. Re: java heap space error when opening a connection
              Gary Graham-Oracle

              Reinstalling the product typically would be indicated only if the stack trace showed a missing class, so in your case reinstalling may not do any good. If you do reinstall, just make sure the target directory is empty.

               

              If this were a 32-bit system (or perhaps a 64-bit system using a 32-bit JDK), with a high -Xms value you might see a Failed to create the Java Virtual Machine error if some other process is running already at that spot, but a heap OutOfMemory error should only occur if the JVM really does need to allocate the memory and exceeds the -Xmx limit.  So make sure to increase -Xmx rather than -Xms.  And it would not hurt to use a 64-bit JDK if that is not already the case. As for running 4.0.2, that is not the final production 4.0 release.  I would move forward to 4.0.3 or even 4.1.1 as soon as convenient.

               

              For the missing Start Page, you could first try Windows > Reset Windows To Factory Settings. If that does not help, you may wish to try deleting or renaming the user profile settings under C:\Users\estevens\AppData\Roaming\SQL Developer\system4.0.2.15.21 (after exporting the connections) and relaunching the product.

               

              Hope this helps,

              Gary

              SQL Developer Team

              • 4. Re: java heap space error when opening a connection
                rp0428

                SQL Dev 4.0.2 on Win 7 Pro, 64-bit

                 

                User has been working with SQL Dev for some time.  Beginning Monday morning, he has this problem.

                SQL Dev starts just fine.

                When he tries to open a connection, it returns  a java heap space error.

                We don't know "what changed".  It was working last week.  We came in yesterday morning to find that all of our workstations had been rebooted over the weekend.  It looks like, from our system change log, that a bunch of security patches may have been rolled out, which certainly looks suspicious, but this one user appears to be the only one with a problem.

                 

                Java heap space

                Exception stack tace:

                 

                java.lang.OutOfMemoryError: Java heap space

                Well, as you know from the other forums, SOMETHING changed on the system and you already have a lead on that.

                 

                With Win7 and forward there are always TONS of changes to policies and privileges. Sounds to me like you may not even be using the same Java version or even sql dev version and preferences that were being used before.

                 

                You could also now have a 32 bit versus 64 bit issue depending on the changes that were rolled out and could have environment issues if things like path settings have been changed.

                 

                What does the Java profiler show in terms of the amount of memory being used by the app?

                • 5. Re: java heap space error when opening a connection
                  EdStevens

                  Gary Graham-Oracle wrote:

                   

                  Reinstalling the product typically would be indicated only if the stack trace showed a missing class, so in your case reinstalling may not do any good. If you do reinstall, just make sure the target directory is empty.

                   

                  If this were a 32-bit system (or perhaps a 64-bit system using a 32-bit JDK), with a high -Xms value you might see a Failed to create the Java Virtual Machine error if some other process is running already at that spot, but a heap OutOfMemory error should only occur if the JVM really does need to allocate the memory and exceeds the -Xmx limit.  So make sure to increase -Xmx rather than -Xms.  And it would not hurt to use a 64-bit JDK if that is not already the case. As for running 4.0.2, that is not the final production 4.0 release.  I would move forward to 4.0.3 or even 4.1.1 as soon as convenient.

                   

                  For the missing Start Page, you could first try Windows > Reset Windows To Factory Settings. If that does not help, you may wish to try deleting or renaming the user profile settings under C:\Users\estevens\AppData\Roaming\SQL Developer\system4.0.2.15.21 (after exporting the connections) and relaunching the product.

                   

                  Hope this helps,

                  Gary

                  SQL Developer Team

                  We changed Xmx from the default of 800mb to 1024mb and that got the use going again.

                  • 6. Re: Re: java heap space error when opening a connection
                    EdStevens

                    rp0428 wrote:

                     

                    Well, as you know from the other forums, SOMETHING changed on the system and you already have a lead on that.

                     

                    With Win7 and forward there are always TONS of changes to policies and privileges.

                    Sure.  And with TONS of changes comes the inability to know what change may have been operative for any given problem, not to mention how coy MS is about explaining the individual and actual changes made.

                     

                     

                    Sounds to me like you may not even be using the same Java version or even sql dev version and preferences that were being used before.

                    A normal push of Windows updates would not included SQL Dev.  And our workstation support group has no responsibility for "custom" apps like SQL Dev, so they wouldn't have added that to a push.

                     

                     

                    You could also now have a 32 bit versus 64 bit issue depending on the changes that were rolled out and could have environment issues if things like path settings have been changed.

                    That's much more believable, but again looks like trying to find a needle among several haystacks.

                     

                     

                    What does the Java profiler show in terms of the amount of memory being used by the app?

                    I'm afraid I'm not familiar with that one.  And when I googled "java profiler", all the hits referenced a variety of 3d party profiling tools - nothing that is native to simply having Java installed.

                     

                    In any event, we got it fixed.  But it still leaves us puzzled on why the problem occurred in the first place,and only on one of a couple of dozen workstations.

                    • 7. Re: java heap space error when opening a connection
                      rp0428

                       

                      What does the Java profiler show in terms of the amount of memory being used by the app?

                      I'm afraid I'm not familiar with that one.  And when I googled "java profiler", all the hits referenced a variety of 3d party profiling tools - nothing that is native to simply having Java installed.

                      I'm referring to the 'jvisualvm' utility that is part of the JDK:

                      https://docs.oracle.com/javase/8/docs/technotes/tools/windows/jvisualvm.html

                      Description

                       

                      Java VisualVM is an intuitive graphical user interface that provides detailed information about Java technology-based applications (Java applications) while they are running on a specified Java Virtual Machine (JVM). The name Java VisualVM comes from the fact that Java VisualVM provides information about the JVM software visually.

                       

                      Java VisualVM combines several monitoring, troubleshooting, and profiling utilities into a single tool. For example, most of the functionality offered by the standalone tools jmap, jinfo, jstat, and jstack were integrated into Java VisualVM. Other functionality, such as some that offered by the jconsole command, can be added as optional plug-ins.

                       

                      Java VisualVM is useful to Java application developers to troubleshoot applications and to monitor and improve the applications' performance. Java VisualVM enables developers to generate and analyze heap dumps, track down memory leaks, perform and monitor garbage collection, and perform lightweight memory and CPU profiling. You can expand the Java VisualVM functionality with plug-ins. For example, most of the functionality of the jconsole command is available through the MBeans Tab and JConsole Plug-in Wrapper plug-ins. You can choose from a catalog of standard Java VisualVM plug-ins by selecting Tools and then Plugins in the Java VisualVM menus.

                       

                      SInce it is part of the JDK (not the JRE) maybe your client doesn't have it.

                       

                      It gives you a good way to see what is going on in the running VM whether it belongs to sql dev or another app.