Topic
25 replies Latest Post - ‏2012-04-18T18:07:36Z by SystemAdmin
yusufe
yusufe
5 Posts
ACCEPTED ANSWER

Pinned topic Link indexer slowing while I am typing java code

‏2009-07-23T05:03:20Z |
during I am typing in java editor (no matter it is a comment or java statement) my RAD gets really slow for short while and blocks typing.
During this issue java.exe is consuming my cpu.
And when I look to process window of RAD I see that "System: Indexing Links" is fired after every couple of characters I type.
Should I disable link indexer; if so how?
Or how can I make it not disturb my typing?
Updated on 2012-04-18T18:07:36Z at 2012-04-18T18:07:36Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    14225 Posts
    ACCEPTED ANSWER

    Re: Link indexer slowing while I am typing java code

    ‏2009-07-24T13:55:07Z  in response to yusufe
    Which version of RAD 7.5 are you using? (7.5, 7.5.1., 7.5.2, or 7.5.3?)
    • yusufe
      yusufe
      5 Posts
      ACCEPTED ANSWER

      Re: Link indexer slowing while I am typing java code

      ‏2009-07-31T04:10:28Z  in response to SystemAdmin
      RAD 7.5.2

      I have tried adding * as filter to link indexer but that doesn't disable link indexer as it says...
      Annoyingly link indexer seems to be checking after every couple of char typing if I have typed any link >:(

      Any more ideas?
      • Jurica_Informatika
        Jurica_Informatika
        7 Posts
        ACCEPTED ANSWER

        Re: Link indexer slowing while I am typing java code

        ‏2009-07-31T05:32:55Z  in response to yusufe
        That's really annoying... Thankfully I don't edit any HTML files so it seems for me this is ok solution. However, this method of disabling link indexer doesn't help with xml files which are still checked.

        I have no idea what could be done to speed up typing. I don't have similar problems when using vanilla Eclipse.
  • Jurica_Informatika
    Jurica_Informatika
    7 Posts
    ACCEPTED ANSWER

    Re: Link indexer slowing while I am typing java code

    ‏2009-07-29T07:44:39Z  in response to yusufe
    Hi!

    I have exactly the same problem, but typing stops not only in java editor but also in xml editor, sqlj editor...

    I already tried to disable link indexer but it made no difference whatsoever.

    The version of RAD that I'm using is 7.5.3.

    Regards,
    Jurica.
  • SystemAdmin
    SystemAdmin
    14225 Posts
    ACCEPTED ANSWER

    Re: Link indexer slowing while I am typing java code

    ‏2009-07-29T17:47:05Z  in response to yusufe
    I am also facing same issue. I am also using RAD 7.5.3.

    Thanks and Regards,
    Samip.
  • Jurica_Informatika
    Jurica_Informatika
    7 Posts
    ACCEPTED ANSWER

    Re: Link indexer slowing while I am typing java code

    ‏2009-07-30T05:36:58Z  in response to yusufe
    Hi!

    I managed to partially solve this problem - I turned off link indexing in Window->Preferences->Web->Links (just add "*" to a list of excluded patterns and ignore the warning). This way typing becomes tolerable. Don't ask me why indexing of everything is set under this page...

    However I'm not sure if this is ok and what part of functionality is lost.

    Regards,
    Jurica.
  • SystemAdmin
    SystemAdmin
    14225 Posts
    ACCEPTED ANSWER

    Re: Link indexer slowing while I am typing java code

    ‏2009-07-31T15:24:22Z  in response to yusufe
    I'm going to try to answer everybody's questions. I'll explain what the indexer does and ways to mitigate your performance issues. If this does not help please contact IBM support.

    First a little background on what all of you are experiencing. The link index serves a vital function for several components in RAD. Links are more than just your typical a href link that goes from page to page. For Java EE apps, it can link from page to Java types, Servlets, JSF Managed Beans, and Struts Actions (in Struts config files).

    The "Visible" functions
    • Creates problem markers for broken links (which has is own preference).
    • Lots of Refactorings: It provides the ability to refactor pages during move/rename (all links will be maintained). If a Java type/method is renamed, all links in JSPs will be maintained. Refactoring JSF/struts artifacts behave similarly. It also allows you to convert links from absolute/relative. Renaming the context root of your application will also refactor links.
    • You can also search for links - the most useful search for web developers is "Incoming links" which will display all links targeting the selected page.
    • It allows you "auto-hyperlink" the links it has indexed when you press ctrl + hover with the mouse over the link. It will underline the link that when clicked will open the target. (F3 is the keyboard shortcut) This is very useful for navigation around the app you are working on.
    Many of these actions are available from the right-click menu in the navigator when you have a resource selected.

    The "Invisible" functions: It's also the foundation for several other components in RAD.
    • The web diagram editor is completely dependent on the link index and only knows about the links that contained in the index.
    • Web site designer is similar.
    • Page designer (the graphical html/jsp editor) has some dependencies on it. (Limited to creating links for artifacts dragged from palette, page data, and project explorer).
    • Page templates (static templates).
    • Page Data View (for struts only).
    • Project/Enterprise Explorer (for struts only).
    • Quick Edit View (for coding JSF actions).

    If you disable the index on a subset (or '*' which disables it all) it will make those resources "invisible" to the index, and thus invisible to all the dependent components.

    The question I have for all of you is - are you seeing a real performance problem when you are typing in an editor? Or could it be that just notice the indexer running after you press some keys?

    The indexer works in an incremental fashion. That means it should not take much time at all to index a single file. Additionally, if that file is open in an editor it tracks the positions of all the links as you move them around. That means that if you are simply typing characters (and not links) the only work that needs to be done is to updates offsets. However, if you add/remove links, the link will be analyzed for its target and if it fixes any broken links. If you remove a link targeted by another page those links will be marked broken.

    The indexer does not run on every keystroke. It tries to strike a balance between keeping the index up-to-date and performance. Every time a keystroke is pressed, a timer is set (or reset) for 750ms. After this timer expires, the indexer analyzes the file. That means that if you are typing a sentence, it will wait until after you are done before continuing. Note: the indexer runs in the background and shouldn't block any UI tasks. That means, it can be running simultaneously with your changes with no adverse affect. (Note, this is a similar pattern followed in other places in Eclipse, like the reconciling that happens when typing in a Java editor).

    So to be clear, it is normal to see the indexer running periodically as you are editing any file. (Any file, since links can appear anywhere.) However if the UI is blocked or unresponsive you are seeing a real bug.

    Workaround
    • Disable the indexer completely (or for the file that is causing problems). The easiest way to do this is to add '*' to the ignored resources list on the preference page: Window->Preferences->Web->Links.
    Note: look at the list of components that will be affected by doing this. Decide if the trade-off of performance vs functionality is acceptable to you. If you don't want to completely disable the indexer, you can exclude the file that is causing you trouble.

    Note: due to a quirk, even after you remove all paths ('*') from the indexer, you will still see the indexer running after each character press. All this is doing is spinning up the background indexer, and then indexer realizes that it has no work to do, and then shuts down. This really should not affect performance right away as this check is very quick, but you may see this job periodically appear in the progress view.

    If you really want to completely disable the indexer there is a master kill-switch. You need to set the environment variable com.ibm.etools.references.suspendAll to the value true. This should completely disable all parts of the indexer. Performing a reindex operation (from the preference page) should re-enable the indexer.

    Question: Would it be worth it to add a way to control the "as-you-type" indexing separately from the regular indexing? There is currently no preference for this.
    • jim_zhang
      jim_zhang
      86 Posts
      ACCEPTED ANSWER

      Re: Link indexer slowing while I am typing java code

      ‏2009-07-31T16:34:24Z  in response to SystemAdmin
      Please make sure to let us know if disabling Link Indexer helps with reducing the slowdown. As Min explained above, it's more likely that you are seeing a bug in other areas and Link Indexer is taking the blame because it's always running. To help us best determine the real cause of the slow down, please produce some javacore dumps during the time period that you experience the slowdown. Here's how to do it:

      =====================
      How do you generate a javacore file? Please follow these instructions: http://ibm.com/support/docview.wss?rs=2042&uid=swg21391829

      Please use these instructions: http://www-01.ibm.com/support/docview.wss?rs=180&uid=swg21153852#ecurep to submit your javacore files. Ideally what we need are two javacore files, spaced more than a minute apart. Please name your file rad75.linkindexer.javacore.<timestamp>.zip.
      =====================

      Once uploaded, please post to this thread to notify us. Thanks!
      • Jurica_Informatika
        Jurica_Informatika
        7 Posts
        ACCEPTED ANSWER

        Re: Link indexer slowing while I am typing java code

        ‏2009-08-03T11:12:43Z  in response to jim_zhang
        Hi!

        Here are the dumps... although I'm not sure I generated them quickly enough (slowdown lasts less than a second... however it is VERY irritating).

        Yes, I think too that link indexer is not the culprit here, but the consequence.

        Disabling the link indexer helps somewhat, unchecking the "Supply link results to Java search" makes even more difference thus making editing java files normal. Editing xml files (and other content) is as interrupted as always, at least for me.

        Hope this helps!

        Regards, Jurica.
    • Jurica_Informatika
      Jurica_Informatika
      7 Posts
      ACCEPTED ANSWER

      Re: Link indexer slowing while I am typing java code

      ‏2009-08-03T11:24:02Z  in response to SystemAdmin
      Hi!

      Thank you for your great explanation on how things work under the hood.

      First if I answer your question - of course it would be worth to add another setting :) but bear in mind that I am the user so when I hear "features" I'll say yes :D

      Seriously though, maybe if there was a way to set the timeout of the indexing, maybe that would be helpful. But indexing doesn't bother me as such, it is the slowdowns and unresponsivness of the gui that really do...

      When you speak of the master kill switch - I probably have to set variable for java process, not the general environment variable of the os?

      Thanks again.

      Jurica.
      • Jurica_Informatika
        Jurica_Informatika
        7 Posts
        ACCEPTED ANSWER

        Re: Link indexer slowing while I am typing java code

        ‏2009-08-03T11:32:40Z  in response to Jurica_Informatika
        Hi!

        Ok, so I've set the "killswitch" by using -D option in eclipse.ini.

        What I'm seeing now is that I can type - almost - without interruptions, however java process consumes 100% cpu (as long as I type).

        Please find attached another dump with killswitch enabled.

        Regards.
        • SystemAdmin
          SystemAdmin
          14225 Posts
          ACCEPTED ANSWER

          Re: Link indexer slowing while I am typing java code

          ‏2009-08-04T14:47:03Z  in response to Jurica_Informatika
          Thank you for your attachments. Unfortunately, they are not useful since they were not taken during the time of the slowdown. This will probably be very hard to capture in action. However, there are other techniques that we can try (like enabling tracing code, etc) I'm interested in helping you further but I think we should do it within the context of IBM support. This will allow us to exchange private information like the projects in your workspace, your computer specifications, and other things that can be affecting the performance. You can find the way to do this here: http://www14.software.ibm.com/webapp/set2/sas/f/handbook/contacts.html

          One more thing that I've found recently is that the Progress View itself can be causing slowdowns. If you are in a XML-type editor (html/jsp/xml) and you press and hold a character, the UI can stutter. If you close the Progress View (in all perspectives) this will no longer happen.

          You might want to try closing the view to see if this can help.
          • Jurica_Informatika
            Jurica_Informatika
            7 Posts
            ACCEPTED ANSWER

            Re: Link indexer slowing while I am typing java code

            ‏2009-08-06T06:07:56Z  in response to SystemAdmin
            Hello again!

            I think that I have no progress view open - just this tiny progress bar in status bar in lower right corner that I was unable to turn off. Is there any way to turn that off, too?

            Regarding the further things that we can do about this problem I'll try contacting IBM support shortly.

            Regards,
            Jurica.
            • SystemAdmin
              SystemAdmin
              14225 Posts
              ACCEPTED ANSWER

              Re: Link indexer slowing while I am typing java code

              ‏2009-08-26T14:52:33Z  in response to Jurica_Informatika
              I recently found out that if you have the "Breadcrumb" for the Java editor enabled, it will cause the Java file you are editing to be indexed an additional 2-3 times after every pause (sometimes up to 3seconds after you stopped typing.)

              Toggling Breadcrumbs (turn them off) could be a good workaround for people that are seeing performance problems. Could someone try that out and update us to see if that helps?
              • yusufe
                yusufe
                5 Posts
                ACCEPTED ANSWER

                Re: Link indexer slowing while I am typing java code

                ‏2009-09-18T11:09:40Z  in response to SystemAdmin
                After I upgraded to 7.5.3 I thought problem is fixed then I realized that again the same problem started to occur,
                I thought about bloating indexes... But apparently I opened breadcrumbs again... Now as Idzelis says when I close it, it is gone!

                toggling breadcrumbs is not obvious;
                type ctrl+3 write bread.. you'll see toggle breadcrumbs command
    • yusufe
      yusufe
      5 Posts
      ACCEPTED ANSWER

      Re: Link indexer slowing while I am typing java code

      ‏2009-08-04T08:21:35Z  in response to SystemAdmin
      Actually this link indexer timeout made think that it is very very short for me maybe... even though there is no reason for that to have different value than default, it would be nice to increase it.
      @idzelis thanks for explaining things in detail. But yes it is really annoying not just because I see it on progress
      • SystemAdmin
        SystemAdmin
        14225 Posts
        ACCEPTED ANSWER

        Re: Link indexer slowing while I am typing java code

        ‏2009-08-04T14:52:31Z  in response to yusufe
        Yusafe: There is currently no way to adjust the frequency of when the indexer runs while you are editing a document. It is re-set to 750ms each time a character is typed. After the timer elapses, the indexer runs incrementally.

        I also noticed that you said you were using RAD 7.5.2. There have been improvements in 7.5.3. I encourage you to move up and see if that will help.

        Like I mentioned in my previous post, you could also try closing the Progress View from all perspectives to see if that will help.

        If you are still seeing problems, please see my previous post on how to contact IBM support.
      • V_I123$$
        V_I123$$
        1 Post
        ACCEPTED ANSWER

        Re: Link indexer slowing while I am typing java code

        ‏2011-01-31T19:39:48Z  in response to yusufe
        Please let me know whether any solution exists for this indexing problem. For every char type system is getting struck up with indexing links. I disabled the web>LInks option in preferences. but still no use and getting struck.
    • yusufe
      yusufe
      5 Posts
      ACCEPTED ANSWER

      Re: Link indexer slowing while I am typing java code

      ‏2009-08-04T08:26:07Z  in response to SystemAdmin
      And btw how can I increase the timeout/reset value for link indexer?
  • SystemAdmin
    SystemAdmin
    14225 Posts
    ACCEPTED ANSWER

    Re: Link indexer slowing while I am typing java code

    ‏2009-08-03T17:03:53Z  in response to yusufe
    Thanks a lot for detailed explanation.

    I tried master kill switch and now I can see characters as I am typing :)) I don't have to wait.

    My RAD is running on linux VM on MAC OS. Thus I am trying find ctrl + Break switch combination to get the dumps:)

    Thanks and Regards,
    Samip.
  • SystemAdmin
    SystemAdmin
    14225 Posts
    ACCEPTED ANSWER

    Re: Link indexer slowing while I am typing java code

    ‏2009-08-03T17:18:00Z  in response to yusufe
    Sorry forgot to answer your question.

    It would definitely help to have some kind of preference to change the timer for link indexer.

    Thanks and Regards,
    Samip.
  • SystemAdmin
    SystemAdmin
    14225 Posts
    ACCEPTED ANSWER

    Re: Link indexer slowing while I am typing java code

    ‏2009-09-25T17:50:19Z  in response to yusufe
    RAD v7.5.4 is now available. Release information available here: http://www-01.ibm.com/support/docview.wss?rs=3539&uid=swg27016213

    This release contains the fix for this problem.
    • ViktorSzentesi
      ViktorSzentesi
      4 Posts
      ACCEPTED ANSWER

      Re: Link indexer slowing while I am typing java code

      ‏2011-01-31T14:05:52Z  in response to SystemAdmin
      I am using v7.5.5.3 and still facing the problem.
      • ViktorSzentesi
        ViktorSzentesi
        4 Posts
        ACCEPTED ANSWER

        Re: Link indexer slowing while I am typing java code

        ‏2011-01-31T14:32:51Z  in response to ViktorSzentesi
        I switched off the Annotation Processing for the project (Java Compiler/Annotation Processing/Enable processing in editor) and cpu usage stays at a normal level.
  • SystemAdmin
    SystemAdmin
    14225 Posts
    ACCEPTED ANSWER

    Re: Link indexer slowing while I am typing java code

    ‏2012-04-18T18:07:36Z  in response to yusufe
    I had a performance problem in RSA, triggered by refactoring operations, which I solved by clearing the shared class cache (https://www.ibm.com/developerworks/java/library/j-ibmjava4/)

    Shut down ALL java/javaw processes
    Open a command prompt with Administrator/root mode
    cd C:\RSA8RTC3\jdk\jre\bin (or your RSA installation)
    java -Xshareclasses:listAllCaches
    javaw.exe -Xshareclasses:destroyAll
    java -Xshareclasses:listAllCaches (verifies that caches were cleared)
    Restart RSA