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

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

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

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

  4. 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 :).

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

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

  7. 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 :(
  8. "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
  9. 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.

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

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

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

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

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

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

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

    Yay, I think you invented ISAPI.

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

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

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

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

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

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

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

  26. 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.
  27. 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?

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

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

  32. 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
  33. 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.
  34. 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.

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

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

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

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