Apr 16 2009

Java Memory Errors During Data Provider Updates in Web Intelligence

Categories: General,Web Intelligence Dave Rathbun @ 5:00 pm

Changing Data Providers in Complex Reports

We have some fairly complex reports at my current client. Of course the word “complex” is not very clear; what is simple to me might be complex to someone else. So let me quantify what I mean by “complex” in this case. The report in question has multiple data provders. Each data provider generates multi-pass SQL because of contexts. Altogether there are 29 data providers with an overall total of over 100 SQL passes. 😯 That’s what I mean by a “complex” report, and I think most folks would agree with that assessment.

The challenge is that for this (and other) complex reports we have been encountering severe issues. In some cases we are unable to edit the queries without restarting our browser session. We also have encountered a number of problems during the process of repointing the document from one universe (development) to another (user acceptance testing) within the same environment.

Current versions of Web Intelligence offer the ability to repoint a document using the following steps:

  • Open the report
  • Edit the query
  • Click the […] button next to the universe in use
  • Select the desired destination universe from the list
  • Review the object mapping and click OK to continue

Side note: I really really like the fact that I can remap individual objects rather than having the process fail as a result of something being missing, but that’s another blog post…

Our problem is that after performing the steps listed above, we wait. And wait. And wait. 🙄 Eventually the session times out. Finally (after much beating of head on desk) I remembered to activate the Java console. (Click Tools and then Sun Java Console from the Internet Explorer menu bar to start the console.) The console shows what’s going on within the Java environment. It seems that I was running out of memory during the attempt to switch universes, and Webi was not capturing the exception properly. Instead of letting me know there was an issue, it was simply… not responding. Nice.

Setting Java Heap Size

Long story short, the memory exception was related to the heap size. So I did some searching on the Sun Java forums and found a number of tips about how to increase this parameter. The exact process will be different based on the version of the JRE that you are using, but the desired parameter is the same either way. If you open a command window and type java -X (which is case sensitve, it must be a capital “X”) the program will return a list of valid parameters. For my version I got this:

java -X
    -Xmixed           mixed mode execution (default)
    -Xint             interpreted mode execution only
    -Xbootclasspath:
                      set search path for bootstrap classes and resources
    -Xbootclasspath/a:
                      append to end of bootstrap class path
    -Xbootclasspath/p:
                      prepend in front of bootstrap class path
    -Xnoclassgc       disable class garbage collection
    -Xincgc           enable incremental garbage collection
    -Xloggc:    log GC status to a file with time stamps
    -Xbatch           disable background compilation
    -Xms        set initial Java heap size
    -Xmx        set maximum Java heap size
    -Xss        set java thread stack size
    -Xprof            output cpu profiling data
    -Xrunhprof[:help]|[:

The one I am interested in is Xmx which can be used to adjust the maximum heap size used by the JVM. Based on some reading, setting this value too high can be just as bad as having it set too low, so I didn’t want to go nuts right away. 🙂 I tried several different values, using my complex report as a test case, and ultimately found that 128m was just fine for me.

The screen used to update this changes based on the version of Java that you are using. I have included screen shots for both 1.4.2 and 1.5 at the end of this blog post.

Conclusion

After making this simple change I was not only able to change the data provider source for my complicated report, but other operations became much more stable as well. I also think that many operations were faster.

Or maybe it was just the fact that they completed at all that made them seem faster. 😉

Java 1.4.2 Heap Configuration

Java 1.5.0 Heap Configuration

11 Responses to “Java Memory Errors During Data Provider Updates in Web Intelligence”

  1. Comment by Sandor

    Yep, that good old -Xmx almost always does the trick when it comes to unresponsive Webi issues. Nice post!

  2. Comment by jwaterbury

    Sweeeeet!! Thanks Dave, this fixes a series of issues that have been defeating me for weeks!

  3. Comment by Dave Rathbun

    For every person that says, “Oh, gee, I already knew about that” it seems there are ten more that had no idea. 🙂 That’s why sometimes even the “obvious” items make it as blog posts.

  4. Comment by Marek

    Maybe a beginner question, but where is this setting done? On the BO server or on the client PC?
    Thank you.

  5. Comment by Dave Rathbun

    The changes discussed here are intended to be made on the client.

  6. Comment by Steven

    I have a question: What if this doesn’t work?

    Like you, I use some very large reports and keep the console open to always see when I have memory issues (which seems to be a lot). But when I add the -Xmx settings (tried everything from 64-256), go into Infoview, then attempt to edit a document/report in WebI I get the error: “The Java Runtime Environment could not be loaded.”

    If I take out the -Xmx parameter, WebI launches without issue.

    Any thoughts?

  7. Comment by Dave Rathbun

    What happens when you run java -x at the command line as suggested in the post? Does it show Xmx as a valid parameter?

  8. Comment by LC

    Hi Dave,

    Dunno whether it’s related.., feel like want to share our issue with Java. Since even BO Support them self also haven’t find the cause and solution for months…
    We tried to use any version, try downgraded version also no use, still got this error. Currently, we use .Net service instead of Tomcat (because we need .Net to comply with our application), our BO version is XI R3.1 (newest vers).

    We keep getting Java Timeout session error when our user click edit reports from Infoview in less than 2 sec.(keep in mind that setting for all session timeout in our universe,CMC,infoview,web.inf already set to max).

    The thing is that sometime we were successfully edit report (webi rpt accessed from infoview/openDoc )and save back to repository folder,…. but most of the time, the error appear when we click edit button OR even if we succeed go to Edit mode, the error prompted when we try to choose folder to save the report back.

    Any idea why…? I don’t think it is session time out issue, but more on other Java configuration thingi ??

    Thanks in advance Dave for any input will help ^_^,

    LC

  9. Comment by Rakesh_K

    What about java 1.6.0_12?

  10. Comment by Dave Rathbun

    I’m not using it, so I can’t say…

  11. Comment by Shibya

    Hi Dave,

    I am getting the same Java Heap Space error while refreshing WebI reports even though the data that we are getting while executing the same query at BEx is not more then 30 records and takes maximum 1 minute.
    Any Idea what can be the reason.