Environment:
running on Win NT 4.00.1381
javac jdk1.2
jdb, version 99/06/11
Java Debug Interface (Reference Implementation) version 1.0
Java Debug Wire Protocol (Reference Implementation) version 1.0
JVM Debug Interface version 1.0
JVM version 1.2.2 (Classic VM, build JDK-1.2.2-W, native threads,
nojit)
Code :------------------------------------------------------ x.java
---------------------------------------
class x
{
x()
{
}
Object get() { return new Object() ; }
static void main(String[] args)
{
int i ;
for (i = 0 ; i < 200000000 ; i++)
{
x xx = new x();
Object o = xx.get();
}
}
}
------------------------------------------------------------------------
Then on command line: (my typing underlined)
javac -g x.java
(version jdk1.2 for javac)
g:>jdb -classpath .;%classpath% -verbose:gc x
Initializing jdb...
> stop in x.main
Deferring breakpoint x.main.
It will be set after the class is loaded.
> run
run x
>
VM Started: Set deferred breakpoint request x:13
Breakpoint hit: thread="main", x.main(), line=13, bci=0
13 for (i = 0 ; i < 200000000 ; i++)
main[1] version
jdb, version 99/06/11
Java Debug Interface (Reference Implementation) version 1.0
Java Debug Wire Protocol (Reference Implementation) version 1.0
JVM Debug Interface version 1.0
JVM version 1.2.2 (Classic VM, build JDK-1.2.2-W, native threads, nojit)
main[1] monitor step
main[1] step
----------------------------------------------------------------------------
---
... debugger now proceeds output every line stepped through until... (after
a minute or two, if you minimize the command window)
either "java" crashes (caught by Doctor Waston on my NT box) or
out-of-memory error occurs in java and a stack trace is dumped out. Is
this some sort of memory leak problem ?
----------------------------------------------------------------------------
---
Eg -- crash of program with stck dump
main[1] main[1]
Step completed: thread="main", x.<init>(), line=4, bci=0
4 x()
Internal exception:
com.sun.jdi.VMOutOfMemoryException
at
com.sun.tools.jdi.JDWPException.toJDIException(JDWPException.java:45)
at
com.sun.tools.jdi.EventRequestManagerImpl$EventRequestImpl.set(EventRequestM
anagerImpl.java, Compiled Code)
at
com.sun.tools.jdi.EventRequestManagerImpl$EventRequestImpl.setEnabled(EventR
equestManagerImpl.java, Compiled Code
)
at
com.sun.tools.jdi.EventRequestManagerImpl$EventRequestImpl.enable(EventReque
stManagerImpl.java, Compiled Code)
at
com.sun.tools.example.debug.tty.Commands.commandStep(Commands.java:512)
at com.sun.tools.example.debug.tty.TTY.executeCommand(TTY.java:351)
at com.sun.tools.example.debug.tty.TTY.vmInterrupted(TTY.java:143)
at
com.sun.tools.example.debug.tty.EventHandler.run(EventHandler.java:83)
at java.lang.Thread.run(Unknown Source)
main[1] main[1]
which seems unreasonnable looking at x.java
----------------------------------------------------------------------------
------