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."

20 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 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.

  2. The perfect solution... by CodeWanker · · Score: 5, Funny

    for making ANYTHING into "Never Goes Down" is a marriage. Dammit.

    --


    "Wow. Now THAT'S a lot of angry Indians." - Lt. Col. George Armstrong Custer
    1. Re:The perfect solution... by grub · · Score: 5, Funny


      Scientists have discovered a food that takes away a woman's sex drive. Wedding cake.

      --
      Trolling is a art,
  3. Re:ABAP? by srinivas_rc · · Score: 3, Informative

    It is a programming language for changes in SAP ERP System.

    --
    I could change the world, but GOD won't give me the source code :(
  4. 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)
    1. Re:So basically... by /ASCII · · Score: 4, Informative

      Yeah, what the author meant with crash proof is that when a crash happens, only the user whos request the application was processing gets an error, and because of the shared closures, the crash may not even be that bad for the one user.

      This scenario breaks down when: there is a bug in the shared classes or the shared closures implementation, when there is a bug causing corrupt data to be written to the shared closuers, when one or more processes trigger a bug which cause them to hog a scarce system resource like memory or CPU time, when a OS bug or a hardware failiure is encountered, etc, etc, etc.

      The ideas outlied are sound for an extremely high availability system, but they are not enough to make the clain unbreakable.

      Some improvements to the outlined strategy: Use a validator to check that the information written to the shared closures is always correct. Mirror the shared closures to another computer. Have a backup computer which automatically picks up if the first one falls down.

      --
      Try out fish, the friendly interactive shell.
  5. 8 years of Java! by Octagon+Most · · Score: 3, Funny

    "eating, sleeping, and drinking Java" for 8 years

    I'm getting the shakes even thinking about that.

  6. Re:ABAP? by KenSeymour · · Score: 4, Informative

    I have heard of it jokingly referred to as "German COBOL."

    If you enter the world of SAP, be prepared for a thousand acronyms.

    --
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Albert Einstein
  7. Analogies Gone Wild! by Momoru · · Score: 3, Funny

    Ok the Ship analogy was good at first, but this is a little rediculous:

    First, it is possible to let the passengers share the ship with some others without meeting them at any time. Some invisible mechanism moves the sleeping passenger out of the ship, storing him or her somewhere outside and puts another active passenger into it, taking care that only one active passenger is in each ship at any moment.

  8. Shared memory w/ processes is no better by Anonymous Coward · · Score: 3, Insightful
    than shared memory with threads. Threads are basically just processes that share the same memory. And it's the shared part that makes resistance to errors or error recovery so problematic.

    If a process crashes then all memory that the process has access to is suspect. If that's all the jvm contexts then they're all suspect.

  9. 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.
  10. Hmmm by knightrdr · · Score: 3, Funny

    I thought my girlfriend was the only thing that didn't go down.

  11. Re:Step on those Beans! by OwnedByTwoCats · · Score: 4, Insightful

    I have programmed professionally in at least 8 languages, including C, C++, perl, and PL-SQL, and have worked in several others in academic or limited settings.

    I have been doing Java since 2000, coming from C++.

    Java isn't bad. It is complete; it has a threading model with appropriate concurrency controls. It isn't that different from other imperitive object-oriented languages. It has automatic garbage collection. After startup, on our applications, the performance difference with C++ is negligible, and what we save with automatic GC is quite bankable.

    My employer used two strengths of Java to justify the move from C++: platform independence, and garbage collection.

    I don't know what jbich wants to see in a language.

  12. 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.

  13. Re:Java and memory leaks and slowness by Decaff · · Score: 4, Informative

    Sure, the java developers will make various excuses, but I loathe every Java app I have ever run.

    Every one? I doubt that very much. If you have used commercial websites you are sure to have used a significant number of websites powered by Java application servers (check the number of .jsp extensions). You 'loathe' all those websites?

    This is the norm, not the exception. It is not flamebait.

    Generally, they are memory leaking pig apps.


    Eclipse, Tomcat, JBoss, ant and all such widely used and successful applications are all memory leaking pigs? This would be surprise to the developers of these applications who have honed and tuned them over the years, and the thousands of contented users.

    How about the thousands of Java games running on mobile devices in a few MB? Are they memory leaking pigs too?

    Sure, there are memory leaking pig Java apps. There are memory leaking pig X apps where X is the language of your choice.

  14. Preventing DOS, not security, is the target by CustomDesigned · · Score: 3, Informative
    The Java VM is already very secure from a code exploit standpoint. The machine model provides an unescapable environment which is equivalent to the hardware "user mode". It is straightforward to extend the API in pure Java to provide logically isolated "processes" and/or users, and many previous projects have done so, for example JDistro. All in all, Java provides excellent protectation against attackers executing arbitrary code and buggy programs corrupting memory.

    However, the standard Java VM does not provide any way for a supervisory process to limit two key resources: memory and CPU. The Thread.stop() call is useless against a malicious DOS attack via Threads with infinite loops since the attacker can simply provide a "finally" clause that perpetuates the loop. Thread.stop() is even deprecated in later version of Java. Furthermore, there is no way to limit the memory that malicious code can allocate via new (unless I missed something in recent versions). So crashing a JVM via malicious applets or servlets is trivial. This is acceptable for a web browser (just restart the JVM), but not so good for server side Java. Furthermore, infinite loops and data cancer (actual memory leaks where the memory is allocated but not referenced anywhere are impossible in pure Java) are common failure modes of honest but buggy software, so JVMs too often crash due to either CPU or memory starvation even when only trusted code is running.

    The goal of the system described is to provide a way to limit CPU and Memory consumption by leveraging the process model provided by the OS. Furthermore, the hardware enforced user mode helps protect against JVM and JNI bugs that might otherwise break the Java machine model (and allow memory leaks/corruption or malicious native code execution). Having multiple layers of protection is always good.

  15. 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).

  16. 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.
  17. Re:Ironic that Apache 2.x is going to threaded mod by Foolhardy · · Score: 3, Informative

    Underneath the Win32 API is the NT Native API. NtCreateProcess can be called with the SectionHandle parameter set to NULL which produces a new process with the same address space as the ParentProcess handle, mapped copy-on-write just like fork. CreateProcess from win32 calls this function to create a new process but does not expose all of the functionaility.
    SFU and the POSIX subsystem have to use NtCreateProcess too, but take advantage of SectionHandle=NULL.

    Cygwin uses copy-on-create to simulate copy-on-write by copying the entire address space to the child. This is slow and wastes memory. The cygwin mailing lists have had endless arguments on why they don't take advantage of NtCreateProcess. Here's a small thread.
    Also, there is the problem that Win32 does a lot more than just call NtCreateProcess: the native function creates a new process but nothing else. It allocates no memory, creates no threads, and loads no libraries. When you call CreateProcess from Win32, it does all that for you. Since Cygwin implements Posix (and related) over Win32, not Posix over NT (as opposed to SFU which is over NT), they feel compelled to use only Win32 functions.
    It would be nice to have a cygwin fork that creates its own subsystem, an open-source SFU, that would take advantage of this kind of thing.

    Depending on fork to provide stability is a workaround for the real problem: the app crashing.
    Besides, if your data areas are well defined, you can put them in shared memory sections and have the children map that copy-on-write at the same addresses.