Directory Studio
  1. Directory Studio
  2. DIRSTUDIO-658

Exiting Directory Studio consumes CPU for couple of minutes

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.2, 1.5.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows 7 64-bit, 6 GB RAM

      Description

      When exiting Directory Studio it goes into some kind of "overdrive" and the process starts to consume 50% of my CPU, i.e. one entire core for 1,5-2,5 minutes before quitting.

      Looking at the process using Process Explorer on the Threads tab it shows a thread with a start address of: MSVCR71.dll!_endthread+0x31 consuming all that CPU time.

      Any idea why it could be doing that?

        Activity

        Hide
        Stefan Seelmann added a comment -

        I could reproduce this issue on linux.

        I observed that it takes longer the more connections are defined in the connections view. So I created some thread dumps with jstack while Studio is shutting down. The result worries me: We call disconnect() for each connection and that calls System.gc(). I'll try to remove at least the System.gc() call because it is totally nonsense.

        "main" prio=10 tid=0x0000000041164000 nid=0x865 waiting on condition [0x00007fed487b0000]
        java.lang.Thread.State: RUNNABLE
        at java.lang.Runtime.gc(Native Method)
        at java.lang.System.gc(System.java:926)
        at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.disconnect(JNDIConnectionWrapper.java:243)
        at org.apache.directory.studio.connection.core.ConnectionCorePlugin.stop(ConnectionCorePlugin.java:157)
        at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:840)

        Show
        Stefan Seelmann added a comment - I could reproduce this issue on linux. I observed that it takes longer the more connections are defined in the connections view. So I created some thread dumps with jstack while Studio is shutting down. The result worries me: We call disconnect() for each connection and that calls System.gc(). I'll try to remove at least the System.gc() call because it is totally nonsense. "main" prio=10 tid=0x0000000041164000 nid=0x865 waiting on condition [0x00007fed487b0000] java.lang.Thread.State: RUNNABLE at java.lang.Runtime.gc(Native Method) at java.lang.System.gc(System.java:926) at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.disconnect(JNDIConnectionWrapper.java:243) at org.apache.directory.studio.connection.core.ConnectionCorePlugin.stop(ConnectionCorePlugin.java:157) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:840)
        Hide
        Jeff MAURY added a comment -

        Calling System.gc from a user code should be forbidden.
        May be detected by an existing/to be created PMD rule

        Show
        Jeff MAURY added a comment - Calling System.gc from a user code should be forbidden. May be detected by an existing/to be created PMD rule
        Hide
        Pierre-Arnaud Marcelot added a comment -
        Show
        Pierre-Arnaud Marcelot added a comment - Fixed at revision 1211595. http://svn.apache.org/viewvc?rev=1211595&view=rev
        Hide
        Pierre-Arnaud Marcelot added a comment -

        Version 2.0.0 M1 has been released.

        Closing the issue.

        Show
        Pierre-Arnaud Marcelot added a comment - Version 2.0.0 M1 has been released. Closing the issue.

          People

          • Assignee:
            Pierre-Arnaud Marcelot
            Reporter:
            Aleks M
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development