Results 1 to 2 of 2
  1. #1
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default java.util.logging.StreamHandler memory leak?

    After many hours of frustration today, I discovered that the following seems to result in a memory leak.

    (pseudo code)

    Logger logger ... (my logger)

    StreamHandler handler = new StreamHandler();

    logger.addHandler(handler);

    logger.info(...);

    It appears that an empty StreamHandler buffers messages unbounded waiting for you to connect an OutputStream. Unsure if this is a bug or a feature.

  2. #2
    Steve11235's Avatar
    Steve11235 is offline Senior Member
    Join Date
    Dec 2008
    Posts
    1,046
    Rep Power
    7

    Default

    Looks to be a feature, although it could use a lot of memory if many messages were written in but never stored anywhere...

Similar Threads

  1. Replies: 2
    Last Post: 08-21-2008, 08:33 PM
  2. java.util
    By Java Tutorial in forum Java Tutorial
    Replies: 1
    Last Post: 02-07-2008, 02:46 PM
  3. Memory Leak using a Swing Application Project
    By iimasd in forum AWT / Swing
    Replies: 0
    Last Post: 11-27-2007, 11:20 AM
  4. Java Logging
    By vaswin in forum Advanced Java
    Replies: 0
    Last Post: 08-06-2007, 02:18 PM
  5. Java Logging
    By vignesh in forum Advanced Java
    Replies: 3
    Last Post: 08-03-2007, 10:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •