4 Replies Latest reply: Aug 20, 2008 5:51 AM by 807557 RSS

    Possible to have servlet make use of RTSJ?

    807557
      Hi,

      I've tried many things (including JVM setting) on a complex web app, wish to make it work fast in 16 cpus linux while it works fast in 2 cpus machine. I found in that 16 cpus machine, only 1-2 cpus keep busy, and the web responds very slow.

      I'm wondering, is it possible to let servlet make use of RTSJ, if so, any example?

      Thanks
      --
      John
      Toronto
        • 1. Re: Possible to have servlet make use of RTSJ?
          807557
          It may be possible to have servlets run in the real-time VM but I can't say that I have heard of it being done, and it would be tricky. The RTSJ does not support class unloading so any dynamic environment like servlets will quickly run out of memory.

          But in any case the RTSJ will not help with your problem. If the app is only using 1-2 cpus then it simply doesn't scale to using 16 CPUs. There is a bottleneck somewhere in the system. Now whether that is in the application, the servlet container or wherever ... I can't say. But that bottleneck is what you need to find. The means of doing that must be found in a different forum however.

          Regards,
          David Holmes
          • 2. Re: Possible to have servlet make use of RTSJ?
            807557
            Thanks David.

            Further question:
            1. What is "RTSJ does not support class unloading"? meaning it doesn't support any thing like J2EE app either?
            2. Can I then within the doGet/Post method of servlet, use RTSJ to deal with business logic?

            --
            John
            • 3. Re: Possible to have servlet make use of RTSJ?
              807557
              john_woo_canada wrote:
              Further question:
              1. What is "RTSJ does not support class unloading"? meaning it doesn't support any thing like J2EE app either?
              The RTSJ requires that Class objects be placed into ImmortalMemory which is a memory area that is never subject to GC and where objects live effectively for the lifetime of the VM. A JVM can only unload a class when it's ClassLoader is unreachable, but each Class has a reference to its ClassLoader, so ClassLoaders can never become unreachable either and hence classes can never be unloaded. The RTSJ wasn't intended (in its initial form which was for the Java ME space) for applications that involve ongoing dynamic class-loading at runtime. JSR-282 is looking at ways to relax this.
              2. Can I then within the doGet/Post method of servlet, use RTSJ to deal with business logic?
              RTSJ isn't a library it's an entire JVM. Your servlet is running in a JVM that is either a RTSJ JVM or not. You could of course use RMI or other inter-process-communication to bridge from the servlet VM to a RTSJ VM, but I don't think that is what you meant.

              Regards,
              David Holmes
              • 4. Re: Possible to have servlet make use of RTSJ?
                807557
                Thanks David. I got it.
                I'd need another new topic for how to do.