Slashdot Mirror


Quest For "Unbreakable Java" Unites ABAP & Java

jg21 writes "Writing an article about "A Java Server That Never Goes Down" is pure hubris, but a German developer who says he's been "eating, sleeping, and drinking Java" for 8 years doesn't seem to care and his article brings to light the aspects of VM we rarely think of as he introduces "user isolation" and tells about some interesting work SAP in Germany is doing in that area, merging the Java and the ABAP worlds."

25 of 198 comments (clear)

  1. Throw it in jail by SIGALRM · · Score: 4, Interesting
    Inside the VM, parallelism is implemented using threads with no separation regarding memory or other resources. In this respect Java has not changed since its invention in the early nineties.
    I agree that ABAP's dispatcher is an excellent model for per-process isolation. Going further in Java, I would suggest adding a portable root jail to the API. This could allow chroot to isolate and/or run the I/O of native subprocesses through a Java SecurityManager, using a user mode filesystem mechanism. In this way you could secure a Java language service... a handy way of adding a final wrapper to the security provided by the JVM.
    --
    Sigs cause cancer.
    1. Re:Throw it in jail by Anonymous Coward · · Score: 1, Interesting

      I would suggest adding a portable root jail to the API

      Interesting idea. Would isolating the JVM into a per-user environment via chroot isolate each session into separate processes or would they still run in a threaded model?

    2. Re:Throw it in jail by GuyWithLag · · Score: 2, Interesting

      Umm... No. Currently the security manager (at least in the Sun JVM, dunno about other implementations) is unique per JVM. While it is possible to create a Security manager that implements per-thread permissions, I haven't seen one yet.

      Note that a true chroot jal is not possible with vanilla java, as there currently is no way to modify filenames from within the usual Java security apparatus.

    3. Re:Throw it in jail by bloo9298 · · Score: 3, Interesting

      I don't see why different security managers would be necessary. What's needed is to give different rights to each thread, and JAAS allows you to do that.

    4. Re:Throw it in jail by Anonymous Coward · · Score: 2, Interesting

      I agree that ABAP's dispatcher is an excellent model for per-process isolation.

      Hrmpf! ABAP and/or R/3 should better not be taken as a model for anything. Hell, even Visual Basic is the work of a genius compared to the convoluted mess that ABAP R/3 is. Dont expect anything to come out of this 'Unbreakable Java' in the next 10 years. A lot of people at SAP would like to get rid of ABAP and see Java as the way out, but it wont be done overnight. Sure they can do interfaces so that you can call Java from ABAP and vice versa, but then it's just a kludge added to a hodgepodge.

      Besides, they dont do this to make Java better in any way, it is done because of the way R/3 works internally, ie. it is the only way to make Java work with ABAP at all. Yes, i do know what i'm talking about, more than i ever wanted to know.

  2. Use DTrace to Isolate Bugs by qw(name) · · Score: 2, Interesting


    I think the first thing he should do is install Solaris 10 with DTrace and debug with a passion. DTrace will reveal all those nasty problem areas making it easier to fix.

  3. Java in one process by killmister · · Score: 2, Interesting

    >>In contrast, Java follows the all-in-one-VM >>paradigm: everything is processed inside one virtual machine running in one operating system process. Well, recently Sun VM and Linux kernel developers have done a lot to improve threading support in kernel and the combination of SUN VM 1.4.1 and kernel 2.6 scales very good.

    --
    MySQL Error 1040: Can't return sig, Too many connections!
  4. Article text by Anonymous Coward · · Score: 0, Interesting
    Developers using Java on clients or in small projects may not believe that there is a fundamental problem with Java's robustness. People working with huge applications and application servers written in Java know about the problem but may doubt that it's possible to build something like an unbreakable Java architecture. Some may even remember the White Star Line promising that their ocean liner Titanic was unsinkable; an iceberg in the North Atlantic proved them wrong and demonstrated that there is no such thing as an unsinkable ship. Is it really possible to build a Java application server that never goes down?

    It's All About Isolation
    The key to understanding robust Java is isolation, isolation, and isolation. Robust applications, especially robust application servers, require a high level of isolation between users. It's not acceptable that an error occurring while processing one user's request may affect all users connected to the system. The complexity of software systems makes it impossible to develop software that is completely free of errors, so errors will always happen. Only isolation can provide real robustness by limiting the impact of errors.

    The design of the Java Virtual Machine ignores the painful lessons operating system vendors have learned in the past 40 years. The concepts of processes, virtual memory management, and different protection modes for kernel and user code can be found in all modern operating systems. They focus on the question of isolation and therefore robustness: an application with errors cannot affect the other applications running in the system.

    In contrast, Java follows the all-in-one-VM paradigm: everything is processed inside one virtual machine running in one operating system process. Inside the VM, parallelism is implemented using threads with no separation regarding memory or other resources. In this respect Java has not changed since its invention in the early nineties. The fact that Java was originally invented as a programming language for embedded devices may explain this approach.

    There Is No Isolation in Java
    Java does not have a problem with isolation; there is virtually no isolation at all. Java tries to avoid dangerous concepts like manual memory management (this is like taking some of the icebergs out of the ocean) and it can't be denied that it provides at least some isolation concepts, but a Java Virtual Machine is still easy to break. For example, class loaders make it possible to partition an application into parts that cannot see and access each other directly, which provides some isolation. Going back to our nautical example from the very beginning, this is exactly what was supposed to make the Titanic unsinkable: the ship consisted of separate compartments and water pouring into the ship was supposed to be stopped by the bulkheads separating the compartments - unfortunately the iceberg was too big and way too many compartments filled up with water. In terms less familiar to the sailor but more familiar to the developer: all the fancy isolation built with class loaders does not help if you have memory leaks, threads running amok, or even bugs in the VM.

    SAP's Approach to Isolation
    SAP's ABAP application server - the powerhouse underlying enterprise-scale R/3 business solutions - was based on the concept of process isolation from the very beginning. It consists of a dispatcher and a bunch of work processes handling the requests. The work processes are normal operating system (OS) processes and the OS provides a high level of isolation for free. The dispatcher guarantees that in one moment exactly one user request is processed by each work process. In case of a crash, only the user currently processed in the crashing process is affected. All other users continue their work and the operating system takes care of the resource cleanup.

    To overstress the ocean liner example a little: the ship is not split up into compartments but every passenger gets its own ship (a

  5. So basically... by bill_mcgonigle · · Score: 5, Interesting
    • run fewer users per VM
    • run more VM's
    • use "shared closures" (fast oo serialization) to get idle users out of the VM's and,
    • use Apple's Shared Classes to reduce memory footprint (needs java 1.5)

    This sound like it's at least as much about fast and effective recovery on crash as it is crash prevention. Which to a web user is the same thing.

    All VM's have bugs so crash-proof is a tall order.
    --
    My God, it's Full of Source!
    OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
  6. This has been the basis of Erlang for 18 years by Anonymous Coward · · Score: 2, Interesting

    It was really fun reading this article as isolation as described in this article has been one of the founding principle of the Erlang VM. Erlang is a concurrency oriented langage created to support the development of robust scalable fault-tolerant applications.

    I strongly recommand reading Joe Armstrong thesis. This is very enligthning regarding this topic and this is real world feedback:

    armstrong_thesis.pdf

    Fortunately, Erlang has been designed from the ground-up for robustness. All feature of Erlang are designed to achieve the robustness goal (Concurrency model, functional programming, error handling, supervisor and worker mechanisms). This is precisely why it will be very difficul to achieve with Java, if even possible.

    I hope this helps,

    --
    Mickaël Rémond
    http://www.erlang-projects.org/

  7. Crash-only software by Earlybird · · Score: 4, Interesting
    Ladies and germs, I give you crash-only software.

    • Crash-only programs crash safely and recover quickly. There is only one way to stop such software -- by crashing it -- and only one way to bring it up -- by initiating recovery. Crash-only systems are built from crash-only components, and the use of transparent component-level retries hides intra-system component crashes from end users. In this paper we advocate a crash-only design for Internet systems, showing that it can lead to more reliable, predictable code and faster, more effective recovery. We present ideas on how to build such crash-only Internet services, taking successful techniques to their logical extreme.
    1. Re:Crash-only software by Anonymous Coward · · Score: 1, Interesting

      Papers are easy to write, software is not. The paper is sort of interesting, but where is a software system that backs it up? Seeing that the paper was written in 2003... They need at least a proof of concept, don't you think? .segmond

  8. my thoughts on java by sevinkey · · Score: 3, Interesting

    Got into Java because of applets... fun to make a website with a little custom control in it. And the language was a nice improvement over C++ since you don't have to manage your memory. There's a lot of stupidness in the language, but it wasn't too bad.

    And development overall in a real-world environment wasn't bad at all. In face I've written in Windows and deployed on Linux for multiple projects now.

    However, with Java client apps it's write-once, debug-everywhere, since every VM has its quirks you have to troubleshoot, and suddenly I have several versions of my software to troubleshoot (last time I did that was circa 99, so maybe it's better now)

    My last java project was a system of servlets for Tomcat which were needed to be up 24/7. The thing works, but the memory leaks were terrible, even making sure I set everything to null after using it, it was a memory bleeding dog.

    My current job uses primarily C# on Windows server, and I'm much more impressed with .Net than java, despite being biased against Microsoft for the most part. The language features are much more clean, like my favorite:
    foreach (SomeObject i in SomeCollection)
    but there's a ton of language features that I don't want to get into here.

    It's the stability and deployment that really got me. I can just compile my code to a DLL (and a couple of stub .asmx files) and throw it up on a webserver in the /bin folder, and I can have me a webservice, or a simple way to access compiled code from a script.

    I still have to reboot windows 2003, but that's just because I keep my patches up-to-date. If I neglect to patch a server, it would stay up longer than the Java boxes. And this stuff runs much faster... almost as fast a C. Sounds absolutely nuts, but it's true.

    1. Re:my thoughts on java by LarsWestergren · · Score: 2, Interesting

      >>Thats not Java, thats your programming.

      >Check again. The garbage collection process


      The garbage collection process is a memory leak how?

      as well as the fact that it does not release memory in some situations for 1 hour or until the application is closed constitutes a leak.

      I can't comment on all java applications of course, but this IS usually a mistake in programming. One possible example - an application which has a separate window for configuration etc. The programmer remembers to null the obvious reference to this window when it closes but still has a strong link (for instance an event observer) remaining to it. The window, all its buttons and widgets, and all their associated objects will not be garbage collected.

      Weak references should be used much more often.

      --

      Being bitter is drinking poison and hoping someone else will die

  9. My experience has nothing to do with user iso... by Anonymous Coward · · Score: 0, Interesting

    My experience has nothing to do with user isolation. I as a network/systems engineer have spent more time troubleshooting JVM than any other part of the ecommerce eco-systems I support.

    Java has the following problems:
    1. no one person really knows all of the Internals. I have seen the crap feedback from both the Tomcat mailing lists as well as commercial support for JRun. We paid $2500 a day for a JRUN expert who was a dork. I found out more piling through truss/strace results then they found.
    2. Garbage collection: WTF? Can no one get this right? I love watching java buckle becuase of crap you have to go to to 'tune' it.
    3. Load testing NEVER reflects how your app will perform in the wild. I have been on at least twenty commerical load tests with the major vendors. Every time we end up with yet more obscure issues that show their teeth.

    Remember, the more complex your environment, the less likely you'll be able to support it. If the Java people were smart, they would build a better instrumented virtual environment. Don't get me wrong. There are good profiling tools.

    Java is just anything but stable or predictable.

  10. Misssing the point by iamacat · · Score: 2, Interesting

    Current JavaVM implementations are all designed to run as one or multiple user processes on top of the OS. Not surprisingly, such implementations don't duplicate abstractions already provided by underlying platform - like virtual memory or persistent filesystem permissions.

    However, if a VM was running directly on top of the kernel, it could implement these features more efficiently than what must be done for native code and would need little hardware support from the CPU. For example, kernel and user code can pass objects to each other without making a copy or any security concerns.

  11. Nothing new here by IHateSlashDot · · Score: 3, Interesting

    I read the article hoping that it would have some useful info in it but came away extremely disappointed. Wow! A process based dispatch model. How novel. You mean crashing a process doesn't bring down the whole application? Let me think. Oh yeah. I remember learning something about that in the 70s. Pretty new concept. Come on now. The whole basis for this model is flawed. It uses multiple processes and then slips in the fact that it uses shared memory to communicate between the processes. This makes the whole model practically useless in any real world scenario. I've built systems that handle many ten of millions of users. Production systems mind you (you know, people actually pay money to use them and rely on them. They are still running today happily processing hundreds of millions of requests per day. Those were all multithreaded servers and have an average downtime rate of just a handful of minutes per year. (By contract they are only allowed only an hour of downtime per year including upgrades). Writing robust servers just requires some basic skill, not a new paradigm (or in this case an archaic paradigm).

  12. Check out the Isolation JSR by AdamInParadise · · Score: 4, Interesting

    There is already a JSR for that would define a standard for Jail-like compartments in a single JVM process:
    JSR 121: Application Isolation API Specification

    Problem is, this JSR is going nowhere. There are some big corps onboard, but no one seem's interested in defining a common API. Sun's management is clearly not interested (more precisely, "Sun's managment has decided not to commit any resources to this project in the short term.") So there are lots of research papers, prototypes and Master's thesis, which are all very interesting, but no working implementation that everyone can use.

    That's really sucks because with an implementation of this JSR, the JVM could get a lot more OS-like. Too bad.

    --
    Nobox: Only simple products.
  13. Ever hear of Tandem by Anonymous Coward · · Score: 2, Interesting

    There used to be a company called Tandem (bought out by Compaq, then HP) that produced a computer system with no single point of failure.

    You could write programs in a language called TAL (Transaction Application Language) which provided the ability to checkpoint. Doing this, your program could initialte a primary and backup process. The backup process would run on a different CPU. By checkpointing, the application could keep the primary and backup process in sync. If, for some reason, the primary process were to fail, then the backup would take over.

    Tandem's were heavly used in the financial industry. Unfortunatly, Compaq (and HP) seemed to down-play (or didn't understand) the true potential for these systems.

    These computers a still being used, but are so under-sold for the potential they have.

    Anyone out there in /. land using Tandem's?

  14. Summary of the Crash-Only paper by truth_revealed · · Score: 2, Interesting

    Use the same code for the start-up sequence of your program as you do for crash recovery - treat them the same. Fewer lines of code leads to less chance of an error. That's all.

    1. Re:Summary of the Crash-Only paper by Earlybird · · Score: 2, Interesting
      • Use the same code for the start-up sequence of your program as you do for crash recovery - treat them the same. Fewer lines of code leads to less chance of an error. That's all.

      Not just that -- accept that crashing is a valid way of shutting down your program. In other words, be kill -9-safe. Also, include crash recovery in the first place; an orphaned pid file (hello, Jabberd!) or an orphaned lock file (yo, Lucene!) should not prevent a program from starting up. It's incredible how prevalent these little rough edges are.

  15. Ironic that Apache 2.x is going to threaded model by Anonymous Coward · · Score: 1, Interesting

    It is ironic that Apache 2.x is going to a multi-threaded model from the safer fork-based model. Isolation and 30 years of OS research be damned.

  16. Re:Ironic that Apache 2.x is going to threaded mod by ttfkam · · Score: 2, Interesting

    It is ironic that Linux is going to the monolithic kernel model from the safer microkernel-based model. Modularity and 30 years of OS research be damned.

    Just because people have found that a hammer is the most generalized tool does not make the world full of nails.

    --

    - I don't need to go outside, my CRT tan'll do me just fine.
  17. Re:Java and memory leaks and slowness by Decaff · · Score: 2, Interesting

    ant is a really simple cmd-line process, I can't see how it leaking memory would be a big deal.

    It's certainly not simple! It is used for large-scale production builds and scripting. It's also used as a plug-in, often for repeated and automated tasks within other programs, where leaks would definitely show. (Actually, there have been *past* memory leaks in Ant, which caused problems in these situations).

    However, if you sincerely think that Eclipse doesn't leak memory like a sieve, then I claim that you don't do your day-to-day in it.

    I don't (I use NetBeans), but I know many who do, and without problems. Eclipse is a very, very widely used product. It's not used just for Java, but also for C++ and other languages. It is also the foundation for many custom applications, and is used for long periods. Eclipse is a well-respected and very well debugged application.

    When there have been reports of memory leaks in Eclipse, these have been due to faulty plug-ins.

    It is fair to say that Eclipse has a high start-up memory requirement, but I see no evidence or reports that it has any significant memory leaks.

  18. Re:Ironic that Apache 2.x is going to threaded mod by BillyBlaze · · Score: 2, Interesting
    Cool, it's nice to know that this API is documented. Kinda sad that Cygwin doesn't use it.

    I fully agree that forking is a workaround, and it's better not to have the app crash, but better still is both forking and having the app not crash. It's like having computers in a LAN secure from each other - yes, the firewall should work, but it's better not to depend on that.