Exception in jacl-shell when running 'yes'
Brought to you by:
mdejong
'yes' is a unix command that provides a continuous stream of 'y'.
On running this command inside the Shell supplied by jacl, the Shell exited with:
%yes
Exception in thread "Thread-5" java.lang.OutOfMemoryError: Java heap space
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space.
The behavior of native tcl shell is to continue printing 'y' in the terminal.
$tclsh
% yes
y
y
y
y
y
The behavior in jacl should be identical. If it is not, at least the shell should not exit with a java OOM exception.
submitted by rahul.nair@sun.com
Logged In: YES
user_id=90858
Originator: NO
The Jacl implementation of exec waits for the exec'ed subprocess to terminate
before gathering the IO written by that process. If the exec'ed process does
not terminate or just keeps writing then the system will run out of memory
at some point. And Jacl does not implement pipes, so there is no really good
way the deal with the situation you describe in the current codebase. I am
open to patches to deal with this situation but it is not really a bug as
much as it is something that is not supported.