Re: Re[2]: [linux-audio-dev] LAAGA proposal, part ??

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: Re[2]: [linux-audio-dev] LAAGA proposal, part ??
From: Greg Turpin (gregturp_AT_home.com)
Date: Mon Jun 11 2001 - 01:40:28 EEST


System.gc() calls the garbage collector in java. It's public
too.

According to the javadocs:

"Calling the gc method suggests that the Java
Virtual Machine expend effort toward recycling
unused objects in order to make the memory they
currently occupy available for quick reuse. When
control returns from the method call, the Java Virtual
Machine has made a best effort to reclaim space
from all discarded objects."

Now, by no means am I suggesting that anyone use
Java for audio. If you let java decided when to run
garbage collection - you'll run out of memory. If you
decide to call System.gc(), your application will suffer
a MAJOR performance penalty.

Personally, I view Java as a professional (and commercial)
SCRIPTING LANGUAGE. But, that's just my opinion.
As far as I'm concerned:

The lowest level is assembly (although not at all portable).
The second lowest is C (which CAN be portable).
Then, there's everything else. I lump C++, Perl, Python, Java
all into this last category. Although, Perl has been known to
put most other languages to shame in certain situations.

Just my viewpoint,

  Greg

 

On Sunday 10 June 2001 12:59 pm, you wrote:
> SH> On Fri, Jun 08, 2001 at 04:08:31PM -0700, Simon Per Soren Kagedal wrote:
> >> On Fri, Jun 08, 2001 at 12:05:15PM +0100, Steve Harris wrote:
> >> > Just incase anyone thinks Java is a stupid example I did a test with
> >> > gcj. It's performance on dsp-type code is withing spitting distance of
> >> > c++'s.
> >>
> >> Hey, that's excellent! What about gcj's garbage collector? Is it
> >> friendly to realtime stuff?
>
> SH> I doubt it, but it probably doesn't go away and do things unbidden.
>
> The problem with garbage collectors is that in most cases, they are
> implemented in a way that is obscured from the programmer, oh, or
> should I say, "handled automatically". Every garbage collection
> implementation has by design "gone away and done things unbidden".
> Big things that take a lot of time, in fact.
>
> For realtime programming, it would be important that the garbage
> collector be put under control of the programmer. C already
> has a way of doing this: free(). ;-)
>
> I don't know as much as I should about Java to be writing this, but
> when I've Java programmers about this in the past, they've said,
> "Oh, sure Java can be used for audio." But when pressed about the
> garbage collection issue, they have told me that it is not possible
> for the programmer to control it explicitly. As far as I'm concerned,
> this disqualifies Java for realtime (incl. audio) programming. It
> simply isn't acceptable to have the runtime system (garbage collector)
> cut in at random moments to perform huge tasks before anything else
> is allowed to happen.
>
> If anyone knows more, and can tell me for sure that I'm mistaken,
> I'd very much welcome your comments!
>
> - Jay Ts

-- 

============================================= Greg Turpin gregturp_AT_home.com

This space available for advertisement.

=============================================


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Mon Jun 11 2001 - 03:10:05 EEST