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

137 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. 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,
    2. Re:The perfect solution... by drudd · · Score: 1, Funny

      Yeah, I used to laugh at such jokes... then I got married...

      Doug

      --
      Venn ist das nurnstuck git und Slotermeyer? Ya! Beigerhund das oder die Flipperwaldt gersput!
    3. Re:The perfect solution... by iggymanz · · Score: 1

      heheh, it seems wives are like gas stations, some are full service, some have partial service, and others make you self service.

    4. Re:The perfect solution... by Anonymous Coward · · Score: 1, Funny

      Well you could just leave the wife for a night and visit the town pump.

  3. I had a secretary once by Prince+Vegeta+SSJ4 · · Score: 1, Offtopic
    that used to make our Java. I thought that it was typically pretty easy to make, but she seemed to break it every time.

    Now I just Buy Mine on the way to work. So far so good.

  4. ABAP? by bogaboga · · Score: 1, Redundant

    It seems I have been sleeping under some rock! For this is the first time I am hearing of ABAP.

    1. 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 :(
    2. 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
    3. Re:ABAP? by WinterSolstice · · Score: 2, Informative

      Actually, it is really a fairly nice language to work with. Not perfect, but very tightly integrated into the workflow. If a user can do something in the system, a good bapper can re-create it with ABAP for other users. Fairly nice for business stuff.

      Like Cobol. Or AppleScript ;)

      -WS

      --
      An operating system should be like a light switch... simple, effective, easy to use, and designed for everyone.
    4. Re:ABAP? by Spellbinder · · Score: 1

      in some ways it is very nice to the developer
      but overall SAP R/3 is one big mess
      you can "see" how it grew over the past 30 years
      that it is a mess does not mean it is bad or something
      you just can't learn something and append it to any other part of the system without some surprises
      it's strongest part is that it integrates anything!!! so tight
      you could even speak of "One system to rule them all" if you just tried hard enough i am sure you would find a module to manage your toilet paper usage

      --


      stop supporting microsoft with pirating their software!!!!!
    5. Re:ABAP? by tanguyr · · Score: 1

      One interesting thing about the whole SAP/ABAP world: during the most recent downturn in IT hiring, demand for SAP developers was one of the least affected.

      --
      #!/usr/bin/english
    6. Re:ABAP? by Spellbinder · · Score: 1

      yeah... i realy appreciate that

      --


      stop supporting microsoft with pirating their software!!!!!
  5. i think it just went down by hsmith · · Score: 1

    kekek, never say never, didn't Fable teach you anything

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

    1. Re:Use DTrace to Isolate Bugs by qw(name) · · Score: 1


      Not really. N1 Grid Containers will allow the admin to basically chop up a machine into "virtual machines" or "environments." For example, a 12 CPU machine can be changed from a single server into 4 three CPU machines making it possible to have a development server and 3 test servers. N1 Grid Containers are much more than this but it just an example.

      DTrace comes with Solaris 10 and it allows you to watch basically ever aspect of a program's execution. It can tell you how many times it pounds a particular library, which area of that library is being called, or even show you the top ten, twenty, etc libraries being called. Libraries were just an example. DTrace will help you make your programs more efficient. It is said that Sun debugged their own kernel using DTrace in Solaris 10.

  7. Mirror @ MirrorDot by william_lorenz · · Score: 2, Informative

    Looks like the JDJ link is already slow to respond, but there's a mirror here at MirrorDot for those who haven't already bookmarked the site from previous Slashdot comments. (No, I'm not at all affiliated with MirrorDot -- just sharing the love :).

  8. 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!
    1. Re:Java in one process by Anonymous Coward · · Score: 2, Insightful

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

      That does not change the fact that those threads are handled by a virtual machine that provide no isolation between them.

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

  9. Already done? by barronVonBackstabber · · Score: 2, Insightful

    Isn't this what Oracle did with the Oracle virtual jvm that started in 8i? and that was a looooong time ago. Though having used SAP I can see why it would take them years to catch up with the rest of the world.

  10. "eating, sleeping, and drinking Java" by RicochetRita · · Score: 2, Funny
    Hrmm...sounds like a bad Slashdot poll option. ;-)

    R3

    --
    Stuff that matters: circuitbreakers, vacuum-cleaners coffee makers, calculators generators, matching salt+pepper shakers
  11. 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.
    2. Re:So basically... by Anonymous Coward · · Score: 2, Informative
      Have a backup computer which automatically picks up if the first one falls down.

      If its a hardware failure and you can start from the beginning maybe. But thats a lot harder to do than you make is sound given that realtime systems often cant miss a heartbeat and must keep on processing. I have spent much of my professional life writing code to do just that, and without having facilities built into the OS you have to write a lot of application level code to make it happen. Each application needs to be aware of all replicas, and in order for any replicas to take over they need to have the same "state".

      The real problem is that the "state" made the first copy fail, so how does the copy keep from failing given the same conditions? If the logic is buggy then they will all do exactly the same thing given the same inputs. Migrating the process to another machine is a whole can of worms in and of itself.

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

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

    1. Re:Analogies Gone Wild! by Anonymous Coward · · Score: 1, Insightful

      Haha, I stopped reading the article at that point. If this article is written for programmers with experience in Java, I see no reason to dumb it down like that. I am surprised he didn't just compare it to MSDOS. Like he said, Java was designed for embedded systems, and that's why "all those passengers are in one ship" The problem he points out lives in the original design. When you start changing the original design quite much, you no longer end up with the same product. .segmond

    2. Re:Analogies Gone Wild! by roman_mir · · Score: 1

      I have a suggestion for the next /code release: add a feature to the code that will scan the comments after they are submitted and searches for grammatical errors. When an error is found, the incorrect word would be then shown in red in brackets, and a correct word would be put outside of the brackets with a link to the dictionary.

      Basically embarrass the posters by highlighting their errors to everyone and at the same time draw their attention to the errors.

      I bet after implementing such a system this site would be almost completely red, but after a few months the redness would gradually go away.

    3. Re:Analogies Gone Wild! by PetiePooo · · Score: 1

      For example:

      I have a suggestion for the next /code release: add a feature to the code that will scan the comments after they are submitted and [searches] search for grammatical errors. When an error is found, the incorrect word would be then shown in red in brackets, and a correct word would be put outside of the brackets with a link to the dictionary.

      (Sorry, can't change font color, so pretend the bold word above is red..)

    4. Re:Analogies Gone Wild! by behindthewall · · Score: 1

      It sounds like it's straight out of a Star Trek TNG or Voyager episode. I believe both of those Trek's had an episode involving abduction/substitution during sleep.

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

    1. Re:Shared memory w/ processes is no better by Anonymous Coward · · Score: 1, Informative
      You could still wind up with a corruption, but you can make it fairly resistant.

      process P1 - starts user session S1, create session in memory, write session to closure S1C1 and append CRC.

      At the next point in handling S1 the original process doesn't matter, any process can grab S1C1 and validate the CRC. Any process working on the session data only works on a copy, a change will create S1C2, S1C1 will remain until S1C2 is final and no process is using it any more.

    2. Re:Shared memory w/ processes is no better by maysonl · · Score: 1
      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.
      No, only the memory to which the failed process has write access is suspect. The shared stuff is read-only.
  15. Re:speed.. by Anonymous Coward · · Score: 1, Insightful

    Score: -1, Idiot Who Has Never Written A Line of Code in His Life Yet Wants To Sound Like a Hardened Programmer By Making Retarded Comments About Stuff He Clearly Knows Nothing About

  16. Titanic? by Anonymous Coward · · Score: 1, Funny

    What does he mean "Titanic"? Software is like a car, not a boat!

  17. It's funny laugh! by dfj225 · · Score: 1, Funny

    "Normally less than 10 percent of the users connected to a system are actively sending requests; the others are thinking about their next action or typing in some data at the front end (thinking users)."

    Thinking users?!?! I didn't know this article was supposed to be funny!

    --
    SIGFAULT
    1. Re:It's funny laugh! by CdBee · · Score: 1

      Thusers
      Now Lusers has an opposite

      --
      I have been a user for about 10 years. This ends Feb 2014. The site's been ruined. I'm off. Dice, FU
    2. Re:It's funny laugh! by Aaron+England · · Score: 1

      It's not really funny at all.

  18. 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/

  19. Step on those Beans! by jbich · · Score: 1, Troll

    My intention isn't to troll here, but...

    Does anyone that knows more than just java as a programming language actually like it? I know a few lanauges, scripting and programming, and was introduced inevitably to java back in 2002 or so.
    I hated it right from the get-go. The total operating system independence is the only thing that's cool about this language in my opinion.

    The language itself is clunky and overly complicated, not to mention annoying, and the vm is a total resource hog. Everything is slow, and well .. enough of that...

    After reading this article, I think I actually loathe it now.

    Now if you excuse me, I'm going to go clean out all the hate mail I'm getting from the "I've been eating, sleeping and happily married to java.. exuse me? C? C++? Perl? What the heck are those?" people...

    --
    ---- How absolute the knave is! We must speak by the card, or equivocation will undo us. -Shakespeare
    1. 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.

    2. Re:Step on those Beans! by SoTuA · · Score: 1
      Does anyone that knows more than just java as a programming language actually like it?

      I know perl, php, java, C (although I haven't used it for so long I can barely code a hello world anymore), and have dabbled a little in lisp and prolog.

      I like Java.

    3. Re:Step on those Beans! by KenSeymour · · Score: 2, Insightful

      I used to code in C (7 years). I used to code in C++ (another 7 years).
      I have used Perl and Python.
      I prefer Java for the following reasons:

      1) I like programming in an object oriented style.
      2) C++ has lots of gotchas. My favorite is having to recompile client code for a class when the size of instances changes.
      3) Java has a thriving job market. Smalltalk was to hard to get ahold of a widely used compiler (fork over a thousand dollars or more).
      And then once you learned it, you had to move to the few towns in which there was a job.
      4) You can write cross-platform code that uses serial ports, network sockets, GUI code, encryption and much more without doing #ifdef or automake or autoconf stuff.
      You just write the code once, as they say.
      5) I work on big programs that take a year to write. So the power of the language to help me organize things makes a big difference.
      So Perl, in particular, is out!
      C code gets hard (for me) to manage after about 15,000 lines.

      I use an IDE written in Java all day and I do not think it is horribly slow. Emacs, of course, runs more quickly, but I have to remember a lot of strange key combinations to get anything done and it looks like crap.

      I guess YMMV. Hate and loathe all you want. It leaves more work for me.
      You are entitled to your opinion.

      --
      "We can't solve problems by using the same kind of thinking we used when we created them." -- Albert Einstein
    4. Re:Step on those Beans! by Fujisawa+Sensei · · Score: 1
      How about?
      • Java
      • TCL
      • Bash
      • ABAP
      • C
      • C++
      • Perl
      • Ruby
      • Server Side JavaScript
      • COBOL
      • FORTRAN
      • PL/1
        • Of the languages I listed, I perfer Java?

      --
      If someone is passing you on the right, you are an asshole for driving in the wrong lane.
    5. Re:Step on those Beans! by Decaff · · Score: 1

      You've explained what disqualifies Perl, but with the exception of #3 (thriving job market), what disqualifies Python?

      One reason I use Java is performance. Java used to be seriously slow, but now comes close to C++ speed in real applications. Python is a great language, but remains slow and interpreted. I know there are extensions for uses such as scientific computing, but those are external to python and written in C.

    6. Re:Step on those Beans! by kcelery · · Score: 1

      Please demo your point by writing a VM in java.

    7. Re:Step on those Beans! by KenSeymour · · Score: 1

      I use Eclipse. It is free. It is also pretty good.
      They have plugins for things like Source Safe or CVS revision control.
      I don't care so much for their SQL plugin. I use vienna or Oracle sqlplus for that.

      You can't print from it in Linux but you can in Windows. You would have to ask the eclipse folks why they didn't bother to write
      a function to print pages out in Postscript.

      So I just wrote a javaprint shell script.

      --
      "We can't solve problems by using the same kind of thinking we used when we created them." -- Albert Einstein
    8. Re:Step on those Beans! by prezkennedy.org · · Score: 1

      Don't cry... everything will be ok, I promise! Everyone will forget about it five minutes ago.

      --
      It started back in Team Fortress Classic
  20. 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

    2. Re:Crash-only software by Earlybird · · Score: 1

      Try EROS, which implements orthogonal persistence.

  21. Hmmm by knightrdr · · Score: 3, Funny

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

    1. Re:Hmmm by handy_vandal · · Score: 1

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

      Marry someone else.

      -kgj

      --
      -kgj
  22. Shared memory breaks process isolation by juancn · · Score: 1

    So, following this guy's reasoning, since all code has bugs, a bug might corrupt the shared memory, and therefore, you break all processes!

  23. Re:Why web processes don't communicate with IPC? by Anonymous Coward · · Score: 2, Funny

    Yay, I think you invented ISAPI.

  24. User isolation? by Jeff+DeMaagd · · Score: 1

    The developer seems to be creating isolation from other people by "eating, sleeping, and drinking Java". I hope there is showering in this regimen, and not involving Java.

  25. 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, Insightful

      I apologize in advance if I sound confrontative, however, I find few things on Slashdot more tiresome than when any language X comes up, instead of sticking to the topic, hordes of people are going to yap about their favourite languages Y, Z, W, V...

      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)

      I have personally never come across it, though I had a collegue who claimed to have run across a bug where the JVM on IBMs AIX didn't follow the specifications (forgot where).

      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.

      Er, yes, memory management can be a bit more than nulling objects. Did you every find out what caused it?

      And this stuff runs much faster... almost as fast a C. Sounds absolutely nuts, but it's true.

      So does Java these days for most parts. And Microsoft have the usual advantage of designing their own system on their own operating system. Come back when they have ported their framework to as many operating systems and devices as Sun has.

      The language features are much more clean, like my favorite:
      foreach (SomeObject i in SomeCollection)


      Java has it too these days.

      but there's a ton of language features that I don't want to get into here.

      I can say without any irony or sarcasm: Thank you.

      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.

      WAR files...Tomcat....

      If I neglect to patch a server, it would stay up longer than the Java boxes.

      Are you claiming that there are memory leaks in the virtual machine itself?

      --

      Being bitter is drinking poison and hoping someone else will die

    2. Re:my thoughts on java by jrumney · · Score: 2, Insightful
      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

      Thats not Java, thats your programming.

      [Re C#] It's the stability and deployment that really got me...And this stuff runs much faster...

      Right... My experience is otherwise. The JIT in Java 1.5, JRockit and other high performance JVMs leaves .NET for dead, even for Desktop Graphics, which was an area I was expecting big improvements in due to its tight binding with Windows, vs the much maligned Swing and AWT. And your ease of deployment example differs from Java how exactly? As for stability, it seems you have become a more competent programmer since you left Java, but your experience with .NET obviously does not go too deep within the networking libraries, or other areas where stability is lacking compared with Java.

    3. Re:my thoughts on java by Decaff · · Score: 2, Insightful

      or a simple way to access compiled code from a script.

      As in groovy, beanshell, jython, jcl...

    4. Re:my thoughts on java by Cat_Byte · · Score: 1
      Thats not Java, thats your programming.

      Check again. The garbage collection process 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.

      --
      Two roads diverged in a wood, and I - I took the one the bus load of girls just went down.
    5. 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

    6. Re:my thoughts on java by angel'o'sphere · · Score: 1


      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.


      So obviously you have not understood what a GC does or in other words how a GC works. Setting references to null is not needed. You only need to set the magic reference which holds every thing to null. The memory leak was very likely not in your code but in tomcat or any other library you used at that time.

      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)

      While there are naturally differences in VMs in our days this should not be necessary anymore. If you encouner very strange bugs its more adviced to swicht VM vendor and/or contact the vendor directly. Also there exist very good debugging support in our days.

      And this stuff runs much faster... almost as fast a C. Same for Java :D Sounds absolutely nuts, but it's true. Yes it is true :D

      angel'o'sphere

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  26. 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.

  27. I hope so.... by purduephotog · · Score: 1

    I'm getting married in a few months. I don't want all her sex drive to go away, just a little bit of it. There are days she just won't stop- 5x a night and work is such a drag the next day... repeat over the week and I'm pulling (no pun intended) 120hr work weeks.

    Are all women insatiable like this or did I just happen to hit the motherload?

    1. Re:I hope so.... by PetiePooo · · Score: 1

      Are all women insatiable like this or did I just happen to hit the motherload?

      Is she approaching 40?
      Did she attend a private church-funded school?
      Those are the best reasons I've been able to come up with to explain my situation.

      Knock her up. That put an end to it for me.. All they want to do for the first trimester is sleep.

    2. Re:I hope so.... by Triumph+The+Insult+C · · Score: 1

      Dear Sir,
      I am confused. I am a faithful reader of slashdot.org and don't understand how getting laid this much^H^H^H^H^H^H^H^H^H could be a problem. Can you explain?

      Thank you,
      Triumph (from basement of parents' house)

      --
      vodka, straight up, thank you!
  28. 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.

    1. Re:Preventing DOS, not security, is the target by ad0gg · · Score: 1

      I know .net has AppDomains which are modeled after NT processes which you can run use to isolate code/tasks. Sharing of data between appdomains has to be done over shared memory,.net remoting or someother type of marshaling. You can also unload and load them at will. I think java has something similiar but not as powerful called protected domains.

      --

      Have you ever been to a turkish prison?

  29. I like java... by Anonymous Coward · · Score: 2, Insightful
    I've been writing computer software for over 20 years, from Ada to Zope. Recently, plenty of C/C++ and a lot of TCL and Python.

    I've been doing a lot of Java in the last few years, and I like it.

    There are some warts. It uses a lot of memory, RMI should be transparent, the package setup is not very helpful, and iteration is still uglier than python, but in general most things are there for a reason, with an eye on large project development. This is where things make sense -- you can move, refactor, or whatever and once it compiles it probably runs.

    Swing is a two-edged sword. It probably doesn't do exactly what you want out of the box, but you can beat it into working pretty closely to what you want.

    And the cross-platform stuff really works.

    It gets better if you heavily use the collection classes and the libraries.

    -- ac at work

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

    1. Re:Misssing the point by iamacat · · Score: 1

      I don't see a problem with Java device drivers. But if performance/realtime/dependency considerations require a native one, it can still access data in the original user's object directly without worrying that it will be overwritten in the middle.

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

  32. What's needed is a transaction processing engine by Animats · · Score: 1
    Java, remember, was intended as a client-side concept. As a server-side concept, it provides a useable API to the application programmer, but from the OS side, it's a terrible idea.

    If you want reliability, what you need is a transaction processing system, where transaction programs are quickly started, do their job for one user, and exit. There have been high-performance systems for transaction processing for decades. That's how mainframes work. CICS, TIP, and of course Tandem worked that way. CGI programs also work that way, but because UNIX/Linux is a lousy transaction processing system, they've fallen out of favor.

    If you wanted a real transaction system for Linux, what you'd need is this:

    • Some way to make forkable transaction programs with small dynamic memory footprints and small startup costs. That means a language implementation with shared code, small dynamic data, and short startup time. Perl, Python, or Java would work with some modifications to the run time environment, but a hard-compiled language would be better.
    • Copy on write semantics for transaction programs.
    • Really fast fork. Not fork/exec, fork.
    The basic idea is that the web server starts up some CGI program, lets it do all its initialization, and lets it run to the point that it is ready to accept data for a specific transaction. Then it makes a call to wait for transaction data. When a transaction comes in, the server forks off a new copy of the initialized transaction program. That copy deals with one user transaction, and then exits.

    This gets around the big problem with CGI programs - the initialization cost dominates the transaction. CGI is a good idea from the reliability and security standpoint. If the startup overhead problem is fixed, it's a good solution for high volume applications. You don't want to be doing class loading or source compilation for every transaction. On the other hand, you don't want to share the run time environment between transactions.

  33. 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.
    1. Re:Check out the Isolation JSR by jpick · · Score: 1

      I highly recommend checking out JanosVM, and also reading Godmar Back's KaffeOS paper for more info and background on this stuff. It's super cool.

      I believe the missing needed bits are the Java class verification, of which a lot of work has been done recently on Kaffe (which JanosVM is based on). Plus the Classpath libraries have improved tremendously - this stuff could be a real contender in a fairly short period of time.

  34. 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?

    1. Re:Ever hear of Tandem by civintel · · Score: 1

      yep - I'd been thinking the same thing when reading this article, strange the author didn't mention Nonstop ;)

      And yes, TAL is still used but C++ and Java are supported as well.

      --
      ~information is entropy~
    2. Re:Ever hear of Tandem by Sliptwixt · · Score: 1

      We use Tamdems at the Cable Company I'm currently at. Their billing software resides on them. I don't think I've ever heard of a problem with them, but I really wouldn't know since there's an entire team locked in a room dedicated making sure crashes don't happen.

    3. Re:Ever hear of Tandem by hughk · · Score: 1
      In truth Tandem was a bit of an overkill unless you really wanted non-stop operation, i.e., air-traffic-control, auto-teller back-end servers. In reality, the looser coupled clusters that were built using Digial's VMS tended to give a fairly fast recovery time.

      Looser coupling meant that you were less likely to have the same error immediately on two machines (a danger with Tandem). Of course, data sharing was primarily through the file system and transaction protected files or databases. Slower, but a bit safer.

      There was also a transaction processing system written for VMS called ACMS with transaction protection. You could hang lots of processed onto the framework and they would be protected from each other.

      VMS lives on in many high throughput financial systems, but also thanks to HPaq it is dying.

      --
      See my journal, I write things there
  35. Re:Allow me to explain... by OwnedByTwoCats · · Score: 1

    My employer used to run custom C++ applications for back-end web processing. Now we run Java/J2EE applications for back-end web processing.

    Switching to Java had a negligable change in our hardware budget. "More money for servers" is a myth.

  36. satisfyability by Doc+Ruby · · Score: 2

    Maybe you're just not satisfying her. Is she having an orgasm (or more)? If not, try reading The Clitoral Truth with her - it describes and explains the complex anatomy/physiology of all the female genital stimulation receptors, and how to "work the API" ;). If she is having orgasms, but remains unsatisfied, she probably needs more than sex to be satisfied sexually - like maybe some wedding cake :). Though for women they need a full course meal, including a divorce settlement :(.

    --

    --
    make install -not war

    1. Re:satisfyability by smittyoneeach · · Score: 1

      Dude: "work the API"
      For God's sake, differentiate between code and life, man...

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    2. Re:satisfyability by Doc+Ruby · · Score: 1

      I dunno, I've hacked my girlfriend into a smiley, using my handsfree TFUI ("Touch and Feel User Interface" TM) :P.

      --

      --
      make install -not war

  37. Re:Allow me to explain... by Bill_the_Engineer · · Score: 1
    I've been using JAVA for quite a while now. I must admit that I was dragged "kicking and screaming" to use JAVA, but once I started using JAVA - I liked it.

    I never had the performance problems with any of my JAVA apps that I created or that I used (such as eclipse).

    The performance problems referred by others may be related to the abilities of the JAVA programmer more than the JVM.

    BTW, just so I can be like everybody in this thread. My brag text is that I've been programming for over 23 years and used ASM, C/C++, Forth, Fortran, PHP, Perl, Haskell, Prolog, Java, and some I rather forget.

    --
    These comments are my own and do not necessarily reflect the views or opinions of my employer or colleagues...
  38. first by geekoid · · Score: 2, Insightful

    that's bPfaTA

    How come when I talk to a company executive, they're implementing SAP.
    Nobody ever seem to have implemented it.

    --
    The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    1. Re:first by hughk · · Score: 1
      To be fair, if you want an MRP2/3 manufacturing app (inventory control, costing etc), SAP is pretty cool.

      Unfortunately for other purposes (virtual closes of financials and banking), it seems rather oversold and it runs like a dead dog.

      --
      See my journal, I write things there
  39. 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.

    2. Re:Summary of the Crash-Only paper by truth_revealed · · Score: 1

      We are in violent agreement. True, your program can be kill -9 safe but it does not mean that your program cannot simply exit() when some pre-defined condition arises. (A traditional exit() is also a good way to check for memory leaks with such programs purify and valgrind - but that's another matter). But these ideas are not revolutionary by any means. I thought everyone who writes fault-tolerant servers follows these practices.

  40. Where is "down"? by Doc+Ruby · · Score: 1

    When a program "crashes", "freezes", "chokes", "barfs", becomes unresponsive to GUI/API/network input and likewise appears to remain in a "steady state", what is the program actually "doing" at that time? The CPU probably isn't actually halted; it's probably retrieving instructions and executing them, though not apparently. I always figured that the CPU was in some kind of A/B loop, like

    INSTRUCTION1: EXECUTE INSTRUCTION2
    INSTRUCTION2: EXECUTE INSTRUCTION1

    resulting from memory corruption inserting those bracketing instructions in the codepath. But I'd expect there to be more code intervening most of the time, which would more often generate other results. And at least occasionally for such degenerating garbage generation to corrupt the corrupt loop brackets, ending the loop. But those never happen. What is that crashed process actually doing while it's too busy to talk to me?

    --

    --
    make install -not war

    1. Re:Where is "down"? by Doc+Ruby · · Score: 1

      In humans, as in DSP, "sanity" is the degree of shared context that constrains intelligible communications, in any medium. When a woman goes down on me, though she's too busy to talk, I stay up, and we understand each other perfectly.

      --

      --
      make install -not war

  41. Re:Why web processes don't communicate with IPC? by njcoder · · Score: 1
    Back before J2EE became popular this is what a lot of application servers did. Usually connecting via ISAPI or NSAPI or sometimes cgi.

    I don't remember the names of all the different ones I evaluated but we wound up using Bluestone Sapphire/Web. You would create application servers that would run on your web server or on other boxes that your webserver would talk to. The web server would connect to an application server instance that ran continually.

    Sapphire/Web was a really good development tool. There were a lot of great tools that helped you build applications really fast that would connect to all sorts of data sources.

    Then J2EE came around and all the application server vendors started switching to that. Most vendors started focussing on the server technology and their development tools weren't as rich and easy to use as they were before. All that effort that went into the original tools was lost. It's taken years for the tools to catch back up to where they were before the J2EE switch. Some of the things the tools started using, like EJB's, weren't as fast as the previous business logic members but better tools could be written for something like EJB's as opposed to regular JDBC logic classes. Things like Sun's Sun ONE developer tool did some nice things with the MVC framework as well as other tool vendors but with all the levels of abstraction and the necesity of using so much reflection, things were a bit slow.

    J2EE was supposed to level off the application server playing field and vendors were supposed to compete on their tools for designing solutions for the J2EE app servers. So it seems odd to me that the tools seemed to have taken a big hit when going to J2EE.

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

  43. How's he feel? by john_g_galt · · Score: 1

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

    I'd be concerned that more than his server would break...

  44. Re:Java and memory leaks and slowness by Decaff · · Score: 1

    The focus wasn't code running on someone else's system and you know that.

    No. You said you 'loathed' all java apps you had used. You did not qualify this. There was no 'focus' on what you said - it was a clear statement.

    If the memory leaks on someone else's system, it isn't my problem, is it?

    Yes, because if memory *really* leaked on those systems, they would become unstable and unusable. Java is used widely in critical applications like banking, and ticketing systems. If these systems become unstable, it affects you!

    Java apps, running under Linux or Windows, are far worse than the average for all other apps.

    I assume you have some statistics to back this up?

  45. Re:Java and memory leaks and slowness by Decaff · · Score: 1

    The only bigger assholes than the guy who responded to your original post were the guys who modded him up.

    If responding to vague generatisations with counter examples and facts counts me as an asshole, then I celebrate my assholeness!

  46. Re:My experience has nothing to do with user iso.. by chez69 · · Score: 1

    so you hired a moron to debug a shitty application, so java sucks?

    you can write crappy code in any language, it is up to the programmer not to write crappy code in the first place.

    --
    PHP is the solution of choice for relaying mysql errors to web users.
  47. Re:pffffff dünschiss wie immer..... by Decaff · · Score: 1

    Unite .NET + JAVA or Visual Basic ?

    Already been done! There is J#, and Java support in .Net and Mono.

  48. Re:What's needed is a transaction processing engin by rjstanford · · Score: 1

    The basic idea is that the web server starts up some CGI program, lets it do all its initialization, and lets it run to the point that it is ready to accept data for a specific transaction. Then it makes a call to wait for transaction data. When a transaction comes in, the server forks off a new copy of the initialized transaction program. That copy deals with one user transaction, and then exits.

    Congratulations - you've just invented FastCGI. At least, you would have done if you'd come along a decade or so ago (its been around at least since 1996).

    And yes, its available for use with C, Perl, Python and Java - oh, and Smalltalk, Lisp, Ruby, VMS, and others as well. You can even get supported plug-ins for the more common webservers.

    Alright, so you specify a forced fork rather than an optional one. Still, that's a pretty trivial difference.

    --
    You're special forces then? That's great! I just love your olympics!
  49. Re:Careful... by Decaff · · Score: 1

    Classes aren't the only thing that use memory in Java. Your VMs probably have max heap size set to 512M-1G in the first place...this doesn't include the VM's footprint. Even with 4G of memory, you'll soon be in continuous swap mode if you have too many VMs.

    Those are max heap sizes. Few applications need anything like that, and very few set the size to that value. Before java 5.0, the default max heap was only 64MB. Now its the smaller of 1/4 of memory or 1GB. But, its only a command like switch to reduce it.

  50. Re:Why web processes don't communicate with IPC? by six · · Score: 1


    So why CGI did not choose to cache native processes? a native process could be blocked at some port, then the web server would wake the process up by sending the request to the process through an IPC mechanism. Therefore the cost of launching the request would be minimized, since the process would already be running. A shared memory queue would be the fastest communication mechanism, I think.

    that's exactly what FastCGI servers do, using unix or tcp sockets ...

  51. Re:Java and memory leaks and slowness by maraist · · Score: 2, Informative

    If the memory leaks on someone else's system, it isn't my problem, is it?

    There are very few types of memory leaks in Java, and they are very well understood and isolated. Compare that with C++ which has a greater propensity to leak memory than even c (since many c programmers use the stack instead of dynamic allocation wherever possible).

    In Java, if you have a memory leak, you'll learn about it very quickly, and the memory error/stack-trace/profileability can usually quickly point you in the right direction (fixed-sized class memory, v.s. user-cached-and-not-released objects). In C++, for a sufficiently large app, good luck closing up the sieve.

    Your pain of java means you are most likely familiar with AWT or Swing, which, depending on your VM, can be slow or a memory hog. Moreoever, many Java applications are not tuned to use a realisitic memory size, so there is a slow ramp-up period of excessive garbage collection until a desireable configuration is acquired by the VM. In production environments, this sort of tuning is done prior to roll-out.

    The key difference is that DOS / Windows and even Mac applications are not generally designed for multi-month up-time. So the main difference between Java and non-Java-like applications is not readily apparent to the casual user.

    I do agree, however, that for sufficiently small application life-cycles (such as the UNIX program "ls"), java is innappropriate. But this, again, falls into the category of applications not meant to be run for multiple months.

    --
    -Michael
  52. 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.
  53. Re:Java and memory leaks and slowness by Decaff · · Score: 1

    Incorrect. Memory leaks in those systems are less of an issue because the processes are regularly restarted... Often to deal with memory leaks.

    Not true. Java application servers can be very stable indeed. For example, the free Tomcat server can be run for a very long time without problems (memory issues arise if JSP pages are being constantly recompiled, but this is more likely in a development context, not a deployment).

    Memory leaks (or rather, poor memory management) are common in badly written web applications, but very rare in the web/application servers themselves.

    J2EE servers are used in situations that require very high availability, such as online transaction processing. Restarts are not acceptable in these situations.

  54. Re:Java and memory leaks and slowness by Lord+Omlette · · Score: 1

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

    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.

    --
    [o]_O
  55. Erlang and other approaches by alienmole · · Score: 1

    There's been some discussion of approaches to concurrency recently on the Lambda the Ultimate blog. Erlang is mentioned as well as links to a bunch of other approaches.

  56. Re:What's needed is a transaction processing engin by battjt · · Score: 1

    I don't think fork is what you want.

    My understanding is that there is a preset number of "processes" for CICS. I think we have 4. So for CGI, you would start up 4 processes, get them through initialization, then let them loop on data (incoming requests). If one crashes, restart it.

    To be efficient, all dynamic allocation of anything should be an exception, not SOP, including creating processes. That is why Unix appears slow for batch work; it lends itself to lots of dynamic allocation. Of course, most problems are too complex for that and are best addresses with dynamic allocation, hence the popularity of C/C++, VB, and Java.

    --
    Joe Batt Solid Design
  57. 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.

  58. HotSpot source code is a bad joke by cpeterso · · Score: 1


    Before you put too much faith in "unbreakable" JVMs, you should read the comments about Sun's JVM source code on Slava Pestov's Weblog: "HotSpot source code is a bad joke". scary!

  59. -1, Inevitable? by One+Childish+N00b · · Score: 1

    Where's the -1, Inevitable modifier when you need it?

    --
    Dealing with lawyers would be a lot less tedious if they all looked like Casey Novak.
  60. Re:Java and memory leaks and slowness by Anonymous Coward · · Score: 1, Insightful

    Like most Java-bashers, he uses proof by vigorous hand-waving...

  61. Here's what it stands for... by ninejaguar · · Score: 1
    ABAP is an acronym for "Advanced Business Application Programming". Why they had to develop their own language is a mystery considering the number of available friendly-licensed languages out there.

    = 9J =

  62. Snicker actually.... by purduephotog · · Score: 1

    .... she says she loses count after 5 ;-)

  63. Re:Ironic that Apache 2.x is going to threaded mod by BillyBlaze · · Score: 2, Insightful
    Disclaimer - I say this without specific knowledge of the technical issues facing the Apache developers or of the reason for their choice.

    I blame Windows.

    fork(2) is way better than threads in any application where the forked part doesn't need much communication with the parent. Because when a forked process crashes, there's no way for it to harm the parent. Even if you do need communication, fork mixed with pipes, sockets, signals, or shared memory can be great - a little more programming effort than threads, but you can have better-defined interfaces, you limit the damage a single failure can cause, and you often needn't worry as much about synchronization. Copy-on-write, implicit in fork, is also very useful - I just had to make a threaded program, and I basically had to implement copy-all-the-time (or I could have, at the cost of speed, implemented copy-on-write). If I could have just forked, I could have had processor-supported copy-on-write, which would have been faster, simpler, and smaller.

    But alas, for whatever reason, Windows has no fork. (Let me qualify that - Microsoft SFU has it by somehow going outside the Win32 subsystem (has Microsoft released this API? If not, why not?), and Cygwin somehow fakes it in an inefficient way.) It's a really bad situation - all reasonable definitions of "cross-platform" include Windows, and thus exclude fork(2), so we're all stuck with the fragile solution of using threads and rolling our own copy-on-write.

  64. Cleverly Pimping Net Weaver by codepunk · · Score: 1

    This is nothing more than a cleverly disguised pimping of SAP'S netweaver app server.

    First and foremost SAP I do not want to have to run your hacked up JVM. Is it a good idea, yea probably but implementing it is gonna be hard because of the closed nature of JVM.

    No sys admin and or programmer in his right mind wants to work with or support some third party JVM.

    All that being said what's up JBOSS developers? Is this a good idea? I most certainly trust your skill far and beyond anything these guys can produce.

    --


    Got Code?
    1. Re:Cleverly Pimping Net Weaver by hughk · · Score: 1

      On a previous project we had an 'officially' hacked version of the JVM from SUN. It was still a pain because usually people would install the standard JVM not the hacked version (it was only really needed on the big web servers), but having multiple JVMs around is always a problem.

      --
      See my journal, I write things there
  65. Re:Allow me to explain... by Phil246 · · Score: 1

    I agree pretty much entirely with you.
    I was doing c++ programming as a hobby really for a year or two before i changed my university course to applied computing - which teaches java as part of the course.
    To begin with i was -not- looking forward to it, having heard horror stories about java being slow, clunky and inelegant - indeed i tried a java app out to see what it was like and found it horribly sluggish. Everything about it just felt slow.
    Im no java expert , and my coding skills in either c++ or java are far from adept but i like java more then i liked c++.
    Sure - java has its problems and things about it i dont like, but then so does c++.
    I for instance hate pointers with avengance in c++, like i hate not being able to compile to native code in java so people dont need to run a jvm to run my program
    ( yes i know about programs out there which turn java programs to .exe but every one ive seen isnt free , if you know of any which are , preferably ones which are easy to use, please tell :) )
    On the other hand there are things about java i really do like, such as arraylists which i adore \o/.

    no language is perfect really. Its either very fast, efficient and a nightmare to code in and debug ( assembler, etc ) or easy to understand and code in but absolutely awful performance wise ( visual basic imo but im sure theres worse :D )

  66. Re:Ironic that Apache 2.x is going to threaded mod by LarryRiedel · · Score: 1
    It is ironic that Apache 2.x is going to a multi-threaded model from the safer fork-based model.
    It is ironic that Linux is going to the monolithic kernel model from the safer microkernel-based model.

    Linux has always been monolithic; it has not migrated from a microkernel-based model.

    Modularity and 30 years of OS research be damned.

    Indeed.

    Larry

  67. Pretty Old Insights by thasmudyan · · Score: 1

    Yep, process separation, operating system does it for free, pretty much old news. The thing that bugs me about some Java developers is how they take those concepts like multithreading and separated execution and try to rebuild it painfully with a Java infrastructure, when the VM is probably not the best place to do this.

    For example, when the author talks about the ABAP's process model and how it should probably be rebuild with Java. The idea is basically: One process (or thread) per request, shared session data storage across requests - that sounds like the best place for a classic CGI environment to me. PHP would probably do a nice job, or Perl or anything.

    So if you want those features, why not build on top of Apache, maybe communicate with the client via XML webservices? CGI calls to script interpreters would pretty much provide anything you could possibly needed, while offering customizable degrees of separation *for free* right in the webserver. Why not? Why spend millions to build another bloated Java application server (that may or may not some day be able to support the same kind of featureset that webserver architectures already have)?

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

  69. Re:Ironic that Apache 2.x is going to threaded mod by eric2hill · · Score: 1

    I'm a long time Windows programmer, and I know what the difference is between a process, thread, and fiber. Can you explain what a fork is and why exactly it is different from a thread? If a thread throws an exception or crashes in Windows, it is simply killed off without causing the application to crash. Basically a thread occupies the same memory space as the creating thread, and a process gets a whole new memory space. How does "fork" differ from that model?

    --
    LOAD "SIG",8,1
    LOADING...
    READY.
    RUN
  70. Re:Ironic that Apache 2.x is going to threaded mod by roju · · Score: 1

    Forking duplicates the running process and continues executing from the next instruction. Returns the pid of the child to the "real" process, and 0 to the dup. You end up with two processes, each with its own (identical to the other) address space and data.

  71. Re:Ironic that Apache 2.x is going to threaded mod by BillyBlaze · · Score: 1
    Threads have the same address space, so when one thread changes something, the other thread sees those changes as well. fork() creates a seperate process with a seperate address space that happens to have the same contents as the parent, so changes made in one process won't be seen by the other. (To do what CreateProcess does in unix, the parent fork()s, and then the new child exec()s, which completely replaces its memory with the new executable.)

    To the programmer, it appears that fork() makes a copy of all the memory, but internally, both processes have all their pages marked as copy-on-write. When one process tries to write to such a page, the CPU raises a page fault interrupt (This sounds scary, but it's not - it's also how demand loading of executables and virtual memory works). The kernel intercepts this, and makes a new copy of the page for that process to write on. The overhead is minimal - at fork() time, some tables are copied, and the first time you change something on a page, a pagefault occurs. The CPU was performing the writable check on every instruction anyway.

  72. Re:What's needed is a transaction processing engin by Animats · · Score: 1

    FastCGI is neat, but a different approach. It's basically another level of client/server processing, in which the CGI programs are servers and the web server is the client. Because the CGI programs don't exit after each transaction, they can be corrupted. That's different than a transaction processor.

  73. Re:My experience has nothing to do with user iso.. by alljava · · Score: 1

    Quite frankly a network systems engineer should not have to troubleshoot applications. I would troubleshoot the programmers instead because it sounds like poor programming is the root of your problem.

    Me? 8 years nonstop Java.

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

  75. Re:Ironic that Apache 2.x is going to threaded mod by eric2hill · · Score: 1

    Ah - thanks for the explanation. That's definitely not something easily reproducible on Windows.

    --
    LOAD "SIG",8,1
    LOADING...
    READY.
    RUN
  76. Re:Ironic that Apache 2.x is going to threaded mod by Nevyn · · Score: 1
    If a thread throws an exception or crashes in Windows, it is simply killed off without causing the application to crash.

    In theory this is true in Unix as well, but if the thread crashed or got an exception it wasn't expecting how do you "know" that the memory space of the other threads aren't damaged. Also in theory even though you can allocate mutexes etc. in a way that they'll be released when this happens ... you weren't expecting it to happen and in theory theory and practice are the same.

    --
    ustr: Managed string API with ave. 44% overhead over strdup(), for 0-20B
  77. Re:Ironic that Apache 2.x is going to threaded mod by Foolhardy · · Score: 2, Insightful

    Ummmm, no. Cygwin could detect the type of Windows running at startup and then execute different code based on the platform. Cygwin could load the NtCreateProcess function dynamically when NT is detected and use the old style copy everything method for 9x. One code base, and one binary that behaves differently based on the platform.
    See LoadLibrary, GetProcAddress, , GetVersionEx and VER_PLATFORM_WIN32_NT.

  78. isolation isn't enough by ejoearm · · Score: 1

    I read the arguments about Isolation - but sorry, isolation isn't enough.

    To make things that never fail you need more than one computer!

    The minimal configuration is TWO computers (sorry for shouting) and even that won't work if both computers fail.

    This means you need to do distributed computing - whether you like it or not.

    Stuff that never stops => more than one computer => distributed computing.

    It also implies NO SHARED DATA STRUCTURES (imagine me hitting the keyboard here) - why? - think about it. Computer A has a pointer to a data structuire on computer B - computer B now crashes - ooops.

    So how far have we come? - you need two or more computers, and no shared data structure (oh, and by the way, no sharing implies EVERYTHING MUST BE COPIED) - so you have to copy everything you need to do crash recovery to both machines involved.

    This is very definately NOT how java was designed. Threads SHARE resources - so you have to use one style of programming when using two threads on the same machine but a completely different style of porgramming when using two threads on two different machines - some people might like this - I don't.

    Oh and what more? - stable storage - what's that? Stable storage is storage which survives a crash! You need that as well.

    I think (I'm not really sure) That there are actually 6 different things you need to do to make a fault tolerent system (see pages 27-28) of [1] - isolation in one of them.

    If you want to make fault-tolerent system I'd suggest to read [1] (it's free) - then download [2] and off you go - it's easy.

    Using [2] We have made some pretty reliable systems - as far as I know some of them have never stopped :-)

    Cheers

    /Joe

  79. Re:What does this mean then: by Foolhardy · · Score: 1

    I've read that book, and it's a really good reference. Like I said before, the problem with using NtCreateProcess directly is that it doesn't do all the Win32 specific initialization that CreateProcess exported by kernel32.dll does.

    NtCreateProcess creates an empty process object with no memory, no threads and only the inherited handles. It does not load an executable. It does not load any libraries, except ntdll. It does not connect to the Win32 or any other subsystem. These are all things that kernel32.CreateProcess does automatically. It's easy to create a thread, allocate memory and load libraries into the new process but connecting to the Win32 subsystem is undocumented. Although many of Win32's functions just wrap to a native function or are simple library functions, the Win32 server also maintains plenty of it's own shared state. In order to take advantage of any of Win32's own services, like the windowing environment, you have to register your process with the Win32 server, implemented in csrss and win32k with an undocumented procedure offically accessible only through kernel32.CreateProcess.
    SFU doesn't have this problem because its processes do not (and can not) use Win32's services.

    In the section "Forking a Win32 Process", Nebbett explains and has a code example of exactly how to get fork to work, including contacting the Win32 subsystem. I don't know why the Cygwin developers don't use it, since at least one of them has read the book.
    Another problem mentioned is that most DLLs do not expect to be forked and behave badly, including certain versions of msvcrt. Given that cygwin apps usually only depend on the cygwin library and other unix-imported fork aware code, this shouldn't be a big problem.