Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-599

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space running with a Multiplex channel

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Critical Critical
    • 2.6
    • 2.5.1
    • None

      My test application goes out of memory after about running for ~85-90 mins. (with 2.5.1 groups released version)
      Test app just creates a multiplex channel ( uses UDP protocol) and broadcast the message. (I only have one member in cluster for testing)
      Would you please take a look at the test code and let me know if I am not implementing multiplex channel correctly.
      public class TestJGroups {
      static Logger log = Logger.getLogger(TestJGroups.class);

      public static void main(String[] args) throws Exception{
      BasicConfigurator.configure();
      Logger.getRootLogger().setLevel(Level.DEBUG);
      Logger.getLogger("org.jgroups").setLevel(Level.DEBUG);

      log.info("log4j is set up correctly.");
      log.info("this thread iD: "+Thread.currentThread().getId());

      Channel mulplexChannel2 = createMultiplexerChannel("Service_Registry");
      log.info("I have created mux channgel");

      while(true)

      { //Thread.sleep(10000); mulplexChannel2.send(new Message(null,null,"Hello world".getBytes())); log.info("after sending message to all"); //DaemonThreadUtility.printCurrentDaemonThreads(log.getName()); }

      }
      private static Channel createMultiplexerChannel(String channelID) throws Exception

      { String CFG = "/users/rpatel/sandbox/stacks.xml"; String STACK_NAME = "udp"; ChannelFactory factory = new JChannelFactory(); File configFile = new File(CFG); Channel channel = null; factory.setMultiplexerConfig(configFile); channel = factory.createMultiplexerChannel(STACK_NAME, channelID); log.debug("after createing multiplexer channel"); //DaemonThreadUtility.printCurrentDaemonThreads(log.getName()); channel.connect(channelID); log.debug("after connecting multiplexer channel"); //DaemonThreadUtility.printCurrentDaemonThreads(log.getName()); return channel; }

      }

            rhn-engineering-bban Bela Ban
            sepaton_jira Rita Patel (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: