Closed Bug 145724 Opened 22 years ago Closed 22 years ago

Many java_vm processes spawned

Categories

(Core Graveyard :: Java: OJI, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: Trevor.Jenkins, Assigned: joe.chou)

Details

(Whiteboard: jpibug)

When a single page has a java applet many processes are spawned for the java vm.
This is a significant change in behaviour from say Netscape Navigator 4.6. It so
happens that I have the java run-time soft-linked to the JRE installed by
Nnavigator 4.6 so the issue is with Mozilla.

I'm using RC2 withe following user-agent id:
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0rc2) Gecko/20020510

Yes I know that entry #85319 reports this as invalid but the reasons given are
specious. This is a serious aleteration in behaviour and one that general users
are NOT going to understand.
-> Oji
Assignee: ashuk → joe.chou
Component: Java APIs for DOM → OJI
QA Contact: avm → pmac
And "general users" will poke around in processes and notice that Java has
spawned many threads?
They will once they can't spawn more processes (or in their terms "it doesn't
work").
I did notice the multiple java_vm, but don't understand why.
Re-assign to Jim's group.
Assignee: joe.chou → James.Melvin
Whiteboard: jpibug
if you don't like the reasons for a bug's resolution please complain to the QA 
or the resolver.

*** This bug has been marked as a duplicate of 85319 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
I run comand: "#ps -a" on linux
the following information display:
 
 PID TTY          TIME CMD
 9153 pts/0    00:00:00 run-mozilla.sh
 9161 pts/0    00:00:07 mozilla-bin
 9163 pts/0    00:00:00 mozilla-bin
 9164 pts/0    00:00:00 mozilla-bin
 9165 pts/0    00:00:00 mozilla-bin
 9166 pts/0    00:00:00 mozilla-bin
 9167 pts/0    00:00:00 mozilla-bin
 9168 pts/0    00:00:00 java_vm
 9169 pts/0    00:00:00 java_vm
 9170 pts/0    00:00:00 java_vm
 9171 pts/0    00:00:00 java_vm
 9172 pts/0    00:00:00 java_vm
 9173 pts/0    00:00:00 java_vm
 9174 pts/0    00:00:00 java_vm
 9175 pts/0    00:00:00 java_vm
 9176 pts/0    00:00:00 java_vm
 9177 pts/0    00:00:00 java_vm
 9178 pts/0    00:00:00 java_vm
 9179 pts/0    00:00:00 java_vm
 9180 pts/0    00:00:00 java_vm
 9181 pts/0    00:00:00 java_vm
 9182 pts/0    00:00:00 java_vm
 9183 pts/0    00:00:00 mozilla-bin
 9184 pts/0    00:00:00 mozilla-bin
 9185 pts/0    00:00:00 java_vm
 9187 pts/0    00:00:00 java_vm
 9191 pts/0    00:00:00 java_vm
 9195 pts/0    00:00:00 java_vm
 9198 pts/0    00:00:00 java_vm
 9199 pts/0    00:00:00 java_vm
 9200 pts/0    00:00:00 java_vm
 9201 pts/0    00:00:00 java_vm
 9202 pts/0    00:00:00 java_vm
 9267 pts/1    00:00:00 ps

I run comand "#ps -aL" on Solaris
the following information display:

  PID   LWP TTY     LTIME CMD
  6145     1 pts/3    0:00 sh
 22125     1 pts/5    0:00 run
  6133     1 pts/3    0:34 ttsessio
  6134     1 pts/3    0:15 dtsessio
 22225     1 pts/6    0:00 ps
  6146     1 pts/3    0:08 dtpad
 22131     1 pts/5    3:38 mozilla-
 22131     2 pts/5    0:01 mozilla-
 22131     3 pts/5    0:00 mozilla-
 22131     4 pts/5    0:00 mozilla-
 22131    32 pts/5    0:01 mozilla-
 22131    21 pts/5    0:00 mozilla-
 22131    22 pts/5    0:00 mozilla-
 22131    35 pts/5    0:00 mozilla-
 22131    36 pts/5    0:00 mozilla-
 22131    34 pts/5    0:00 mozilla-
 22134     1 pts/5    0:04 java_vm_
 22134     2 pts/5    0:01 java_vm_
 22134     3 pts/5    0:00 java_vm_
 22134     4 pts/5    0:00 java_vm_
 22134     5 pts/5    0:00 java_vm_
 22134     6 pts/5    0:00 java_vm_
 22134     7 pts/5    0:00 java_vm_
 22134     8 pts/5    0:01 java_vm_
 22134     9 pts/5    0:00 java_vm_
 22134    12 pts/5    0:00 java_vm_
 22134    11 pts/5    0:00 java_vm_
 22134    13 pts/5    0:01 java_vm_
 22134    14 pts/5    0:00 java_vm_
 22134    15 pts/5    0:00 java_vm_
 22134    16 pts/5    0:00 java_vm_
 22134    17 pts/5    0:00 java_vm_
 22134    18 pts/5    0:00 java_vm_
 22134    29 pts/5    0:00 java_vm_
 22134    30 pts/5    0:00 java_vm_
 22134    22 pts/5    0:00 java_vm_
 22134    24 pts/5    0:01 java_vm_
 22134    31 pts/5    0:00 java_vm_
 22134    32 pts/5    0:02 java_vm_
  6087     1 pts/3    0:00 csh

I think this is not a bug, just relate with "ps" 's usage. On linux, default
"ps" command display all light weight process (lwp).

Close the bug?
No. The behaviour is different. The same java vm is being used (soft linked)
with Netscape 4.6. It does not show all these supposed lwps.
I have only Netscape 4.78 run on Solaris 9.
I don't know how to link jre 1.4.0 to netscape 4.x

Trevor, Would you like to check the JVM that you use for your netscape?
Just Click Communicator->Tools->Java Console, the version and provider of
JVM will be displayed on Java Console Window.

Thanks!
Here's what the java console reports:

Netscape Communications Corporation --- Java 1.1.5

However, I am comparing Mozilla 1.0RC2 against Netscape 4.72 not 4.6; where that
versions number came I don't know.
This is the expected behaviour for Sun's Java VM on Linux.
This is not a bug.
Status: RESOLVED → CLOSED
If it';s the expected behvaiour they why don't I see the same behaviour form
Netscape 4.76 whebn both it and Mozilla RC2 are using exactly the same JVM. I
would believe your assertion if they were different JVM's but they ain't they
are identical. Ergo there's still something wrong here.
If it';s the expected behvaiour they why don't I see the same behaviour form
Netscape 4.76 whebn both it and Mozilla RC2 are using exactly the same JVM. I
would believe your assertion if they were different JVM's but they ain't they
are identical. Ergo there's still something wrong here.
Status: CLOSED → UNCONFIRMED
Resolution: DUPLICATE → ---
The VM for <applet> tags in Netscape 4.76 is a proprietary implementation
from Netscape and based on Java 1.1.5.  The VM for Netscape 6.2.2 for
<applet> tags is Sun's Java 1.3.1_02 and 1.4.0_01 EA for Netscape 6.2.2+.
I believe you are using Sun's Java VM for Mozilla and thus are seeing
the expected behavior.  Check about:plugins to see where you are getting
your java support from.  You can also prove this by running any Java 2
applet using Mozilla such as...

  http://java.sun.com/products/plugin/1.4/demos/jfc/SwingSet2/SwingSet2.html

My guess is it will run in Mozilla and will not run in Netscape 4.76.
If it runs in Mozilla, you're using Sun's Java2 compatible VM.
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → FIXED
Okay so despite the link from the mozilla plugin directory to  my exisitng
Netscape 4.72 java it does appear to be using the Sun jvm. However, I still
argue that this (multiple java vm process hanging around) is NOT the expected
behaviour for users. Indeed I'd go so far as to say that is notonly unexpected
but unacceptable. Merely declaring this is the programmer's expected behvaiouir
does not "make it so". Such an "explanation " is a crock, a cop out, a fudge.
Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---
I agree with Jim and Joshua. The multiple java_vm are actually the lightweight
processes (LWP), and the same for mozilla-bin. The difference between Solaris
and Linux is that on Linux, "ps -a" (or "ps -ef") shows processes including LWP,
whereas on Solaris it does not. But if you choose to see LWPs, you can use "ps
-aL" or "prstat -L", etc.

There is a difference of Java vm between ns4.x and ns6.x (or mozilla). In ns4.x,
the java vm usually is embeded inside the browser, not a seperate process,
whereas in ns6.x (or mozilla) java vm is a seperate process. That may be why you
don't see the multiple copies of java_vm (but you should see multiple
mozilla-bin though). If you use the right tag for your applet when running
ns4.x, and installed the Java plugin correctly, as Jim pointed out, then the
seperate Java vm  will be used, and you should see multiple java_vm as well.
This change in perceived behaviour is going to take a lot of explaining to
end-users. Whislt it might be what Sun deem "expected behaviour" anyone, like
me, making the transition from Netscape 4.72 to Mozilla 1 is going to wonder
what the ... is going on.

"If you use the right tag for your applet when running ns4.x, and installed the
Java plugin correctly, as Jim pointed out, then the seperate Java vm  will be
used, and you should see multiple java_vm as well."

In answer to this it has already been pointed in #85319 that this changed
behaviour is observed after visting a web site for which that reporter and this
one too are NOT responsible. It is a live site over which we have absolutely no
control. For the record it is the Formula 1 news site from one of the United
Kingdom's commerical TV companies. So to suggest that we "use the right tag" is
stupid.
>> So to suggest that we "use the right tag" is stupid.

I think Joe is not suggesting that the website change their tags.
Rather, he is pointing out that one could change the default behavior
of Netscape 4.x to use Sun's Java instead of the browsers default
bundled Java, by specifying the right <object>/<embed> tags.  In this
case the default Java is being used to handle the <applet> tag.

The default Java for <applet> tag support is...

  Netscape 4.x:  Netscape 1.1.5 (proprietary)
  Netscape 6.x:  Sun Java 1.3.1_02/1.4.0_01 EA
  Mozilla:       none (need to specify)

Joe is saying one can change the default behavior using html
to point to a non-default JRE to run the applet.

As for Linux threads in the Sun VM, please see the following 
url under "About Linux Threads"...

http://developer.java.sun.com/developer/technicalArticles/Programming/linux

It helps to explain the implementation and why ps reports additional
entries for each thread.
WFIW, this is a dupe, but let's stick with this one (NEW) and leave it for QA to
resolve. Here my observation. Netscape 4.77 smoothly starts java, it does not
show up in `ps x`. top jumps to high activity for a short moment.

Mozilla get unresponsive for a few seconds, 25 processes of java_vm show up, top
displays some of them eating incredible amounts of memory.

pi
Status: UNCONFIRMED → NEW
Ever confirmed: true
Hi Pi,

Please review the URL in my previous reply.  This is not a bug, but rather
the expected behavior for Sun's VM.  (Netscape 4.77 by default loads the
proprietary VM by Netscape).  Again, this is not a bug.

- Jim
Status: NEW → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → INVALID
James.Melvin@east.sun.com keeps posting the same specious response to this
problem. It might be the expected behaviour of a product developed by his
employers but it should be clear from the postings in this and parallel threads
that it is NOT (and will never be) the expected behaviour that USERS are wanting.
Chris Petersen is a new QA contact for oji component. His email is:
petersen@netscape.com
Assignee: James.Melvin → petersen
fixing small error for pmac@netscape.com (filter with : SPAMMAILSUCKS)
Assignee: petersen → joe.chou
QA Contact: pmac → petersen
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.