locks up repl with whitespace
Apologies in advance for the vagueness of this report.
Running the Julia REPL and using Gnuplot with the qt terminal. Plots start out ok but with a lot of points (10_000s) the plot window seems to lock up.
When I then Control-C to interrupt things, I get an error traceback followed by what appears to be a huge amount of whitespace/tabs/carriage returns/newlines in the windows terminal and I am not able to recover use of the REPL.
It appears that if I wait long enough, that whatever is being flushed eventually finishes and then I can resume interaction with the REPL.
It seems that some part of the pipeline interaction with the gnuplot process is generating something that is being buffered. It would seem that filtering out non-informative whitespace from the gnuplot process would resolve the issue.
OS: Windows 10 Pro Julia: 1.6.3 Gnuplot.jl: 1.4.0 gnuplot: 5.2.8
I'm trying to reproduce this on Linux. I see strange behavior and even julia crashes on huge plots, but I never see huge amount of whitespace/tabs/etc.
I'm trying that with the following example:
julia> using Gnuplot
julia> Gnuplot.options.verbose=true
true
julia> @gp rand(100000000)
GNUPLOT (default) print GPVAL_TERM
GNUPLOT (default) -> qt
GNUPLOT (default) print GPVAL_TERMOPTIONS
GNUPLOT (default) -> 0 font "Sans,9"
GNUPLOT (default) set encoding utf8
GNUPLOT (default) unset multiplot
GNUPLOT (default) set output
GNUPLOT (default) reset session
GNUPLOT (default) set term qt 0 font "Sans,9"
GNUPLOT (default) print GPVAL_TERM
GNUPLOT (default) -> qt
GNUPLOT (default) print GPVAL_TERMOPTIONS
GNUPLOT (default) -> 0 font "Sans,9"
GNUPLOT (default) set term qt 0 font "Sans,9" title 'Gnuplot.jl: default'
GNUPLOT (default)
GNUPLOT (default) reset
GNUPLOT (default) plot \
'/tmp/jl_RExcc0' binary record=100000000 format='%float' using 1
^C┌ Error: Error occurred in readTask for session default
└ @ Gnuplot ~/.julia/dev/Gnuplot/src/Gnuplot.jl:511
err = InterruptException()
GNUPLOT (default) Process terminated
Then, REPL stays dead. This happens when I press Ctrl-C after seeing plot in the verbose log. But it is not deterministic. Sometimes different things happen.
Does the above commands trigger your problem?
Also, how does your gnuplot behave if you plot a huge plot directly from it (without Julia)? Something like:
gnuplot> set samples 1000000
gnuplot> plot rand(0)
Does it print some whitespace?
Also, try the windows terminal instead of qt. I usually have much better luck with it when I have to plot on Windows.
Hi, sorry for the long delay in in answering.... I can't reproduce the issue reported by @devel-chm, so please attach some code.
On the other hand I was able to reproduce the problem reported by @wentasah, and it is probably related to memory consumption by the gnuplot process.
Check the following:
# Pass data to Gnuplot.jl and write intermediate data file
@time @gp rand(10^7) :-
2.362971 seconds (30.03 M allocations: 535.959 MiB, 7.25% gc time, 0.50% compilation time)
# Actual plot
@time @gp :-
28.120598 seconds (1.42 k allocations: 54.641 KiB)
So most of the time is spent by the gnuplot process to display the plot.
Considering an even larger number of points:
@time @gp rand(10^8) :-
23.003674 seconds (300.01 M allocations: 5.216 GiB, 2.81% gc time, 0.02% compilation time)
@time @gp :-
fails to generate a plot after the second statement since the gnuplot process completely fills the available RAM on my laptop (16GB), as you may check with e.g. htop.