1

Running on Solaris 10, I am having problems when I hit a LOG.debug statement using an Apache Log4j logger. The basic scenario is demonstrated in the following code block:

public class MyClass {
   private static final Logger LOG = Logger.getLogger(MyClass.class.getName());
   private LinkedHashMap<String, String> myMap = 
         new LinkedHashMap<String, String>();

   public static void main(String[] args) {

      // A really long String, but certainly not exceeding 2^31 - 1 characters 
      //long
      String reallyLongString = "A really, really, really...long String";
      String key = "keyToReallyLongString";

      // When this line is executed, Solaris instantly and completely logs me off 
      // of the system
      LOG.debug("Adding to myMap[" + key + "]: " + reallyLongString);
   }
}

Any thoughts?

Adam
  • 1,011
  • 2
  • 19
  • 37
  • 1
    I find it hard to believe that you get logged off. The process crashing, sure, but logged off? You're going to have to provide an actual failing test case instead of a basic scenario... – Keith Randall Jan 24 '10 at 01:21
  • Unfortunately I couldn't duplicate it in a test app and I cannot post the actual code. We do see this behavior on occasion in other contexts, but this was the only time it was ever consistent. Odd, really... I don't know that it is worth spending any more time on. That one line of debug output isn't worth this much time... – Adam Jan 26 '10 at 00:08

1 Answers1

1

If you have any type of process limits, you might be running into them. By doing that string concatenation, you will use at least (reallyLongString.length() + key.length()) * 2 bytes. If that is enough to push you over your limits…

Paul Wagland
  • 27,756
  • 10
  • 52
  • 74
  • Although I still don't think the string length is an issue (given the calculation you gave, it would be about 27,000 characters), I think you're on to something. On further investigation, I only seem to be able to duplicate this issue when running from within the Eclipse IDE. Is there a particular memory setting that you recommend looking at? Or, is there a setting specific to Eclipse Rich Client Platform applications of which I am unaware? – Adam Jan 26 '10 at 00:26
  • @Adam: I am afraid not… I have never actually seen this issue, and was just throwing out ideas to see if it helped. – Paul Wagland Jan 26 '10 at 06:17