Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 7: julia.exe using 100% of a core when idle #329

Closed
Ummon opened this issue Aug 31, 2020 · 14 comments
Closed

Windows 7: julia.exe using 100% of a core when idle #329

Ummon opened this issue Aug 31, 2020 · 14 comments

Comments

@Ummon
Copy link

Ummon commented Aug 31, 2020

The following notebook output the correct values but after executing the code the associated notebook process julia.exe takes 100% of a whole core of my CPU.

### A Pluto.jl notebook ###
# v0.11.10

using Markdown
using InteractiveUtils

# ╔═╡ 504cc192-eb75-11ea-2b6e-af5d4f828086
begin
	using PlutoUI, Plots, LinearAlgebra
end

# ╔═╡ 5485d760-eb75-11ea-2e25-7b13d58ce554
let
	a = 0
	n = 20
	f(x, y) = let
		v = complex(x, y)
		c = v
		for i  1:n
			v = v^2 + c + a * im
			if norm(v) > 2
				return 1-i/n # Normalized.
			end
		end
		0
	end
	x = LinRange(-2, 1, 1000)
	y = LinRange(-1.5, 1.5, 1000)
	plot(x, y, f, st = :surface, label = false, camera = (45, 80), c = :grays)
end

# ╔═╡ Cell order:
# ╠═504cc192-eb75-11ea-2b6e-af5d4f828086
# ╠═5485d760-eb75-11ea-2e25-7b13d58ce554

I'm using the latest version of Julia (1.5) and Pluto (0.11.10)

@fonsp
Copy link
Owner

fonsp commented Aug 31, 2020

On windows? Which browser?

@fonsp
Copy link
Owner

fonsp commented Aug 31, 2020

Were you running VS Code at the same time?

@Ummon
Copy link
Author

Ummon commented Aug 31, 2020

Windows 7, Firefox 80.0.

And yes, VS Code was running at the same time but I tried without it and the result was the same.

@Ummon
Copy link
Author

Ummon commented Aug 31, 2020

I tried on my other machine which is on Windows 10 and I can't reproduce the issue (Firefox 80.0 and same version of Julia and Pluto)

@fonsp
Copy link
Owner

fonsp commented Sep 1, 2020

Is the UI still responsive while it is at 100%?

There are two julia.exe processes running: the Pluto server and the notebook process. It would be useful to know which is stalling:

If you shut down the notebook from the main menu, one of the processes will disappear. By remembering their CPU and RAM usages, you should be able to tell which one shut down.

@Ummon
Copy link
Author

Ummon commented Sep 1, 2020

It was the notebook process and the UI was still responsive.

@fonsp
Copy link
Owner

fonsp commented Sep 1, 2020

What happens when you Ctrl+C in the terminal? Does it shut down Pluto normally or do you get a stacktrace

@Ummon
Copy link
Author

Ummon commented Sep 1, 2020

Here is the console output. The first errors appeared after the page has been loaded in Firefox.

julia> using Pluto; Pluto.run()
Go to http://localhost:1234/ to start writing ~ have fun!

Press Ctrl+C in this terminal to stop Pluto

┌ Error: (Base.IOError("read: connection reset by peer (ECONNRESET)", -4077), Base.StackTraces.StackFrame[wait_readnb(::Sockets.TCPSocket, ::Int64) at
 stream.jl:350, eof at stream.jl:48 [inlined], read_to_buffer(::HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, ::Int64) at ConnectionPool.jl:253,
 readuntil(::HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, ::Function, ::Int64) at ConnectionPool.jl:273, readuntil at ConnectionPool.jl:271 [in
lined], readheaders at Messages.jl:471 [inlined], startread(::HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSoc
ket}}) at Streams.jl:155, handle_transaction(::HTTP.Handlers.var"#4#5"{HTTP.Handlers.StreamHandlerFunction{Pluto.var"#190#196"{Pluto.ServerSession,HTT
P.Handlers.Router{Symbol("##253")}}}}, ::HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, ::HTTP.Servers.Server{Nothing,Sockets.TCPServer}; final_t
ransaction::Bool) at Servers.jl:343, (::HTTP.Servers.var"#handle_transaction##kw")(::NamedTuple{(:final_transaction,),Tuple{Bool}}, ::typeof(HTTP.Serv
ers.handle_transaction), ::Function, ::HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, ::HTTP.Servers.Server{Nothing,Sockets.TCPServer}) at Server
s.jl:338, handle_connection(::Function, ::HTTP.ConnectionPool.Connection{Sockets.TCPSocket}, ::HTTP.Servers.Server{Nothing,Sockets.TCPServer}, ::Int64
, ::Int64) at Servers.jl:299, (::HTTP.Servers.var"#8#9"{HTTP.Handlers.var"#4#5"{HTTP.Handlers.StreamHandlerFunction{Pluto.var"#190#196"{Pluto.ServerSe
ssion,HTTP.Handlers.Router{Symbol("##253")}}}},HTTP.Servers.Server{Nothing,Sockets.TCPServer},Base.RefValue{Int64},Int64,Int64,Bool,HTTP.ConnectionPoo
l.Connection{Sockets.TCPSocket}})() at task.jl:356])
└ @ HTTP.Servers G:\Program Settings\.julia\packages\HTTP\atT5q\src\Servers.jl:264
┌ Error: (Base.IOError("read: connection reset by peer (ECONNRESET)", -4077), Base.StackTraces.StackFrame[wait_readnb(::Sockets.TCPSocket, ::Int64) at
 stream.jl:350, eof at stream.jl:48 [inlined], read_to_buffer(::HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, ::Int64) at ConnectionPool.jl:253,
 readuntil(::HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, ::Function, ::Int64) at ConnectionPool.jl:273, readuntil at ConnectionPool.jl:271 [in
lined], readheaders at Messages.jl:471 [inlined], startread(::HTTP.Streams.Stream{HTTP.Messages.Request,HTTP.ConnectionPool.Transaction{Sockets.TCPSoc
ket}}) at Streams.jl:155, handle_transaction(::HTTP.Handlers.var"#4#5"{HTTP.Handlers.StreamHandlerFunction{Pluto.var"#190#196"{Pluto.ServerSession,HTT
P.Handlers.Router{Symbol("##253")}}}}, ::HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, ::HTTP.Servers.Server{Nothing,Sockets.TCPServer}; final_t
ransaction::Bool) at Servers.jl:343, (::HTTP.Servers.var"#handle_transaction##kw")(::NamedTuple{(:final_transaction,),Tuple{Bool}}, ::typeof(HTTP.Serv
ers.handle_transaction), ::Function, ::HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, ::HTTP.Servers.Server{Nothing,Sockets.TCPServer}) at Server
s.jl:338, handle_connection(::Function, ::HTTP.ConnectionPool.Connection{Sockets.TCPSocket}, ::HTTP.Servers.Server{Nothing,Sockets.TCPServer}, ::Int64
, ::Int64) at Servers.jl:299, (::HTTP.Servers.var"#8#9"{HTTP.Handlers.var"#4#5"{HTTP.Handlers.StreamHandlerFunction{Pluto.var"#190#196"{Pluto.ServerSe
ssion,HTTP.Handlers.Router{Symbol("##253")}}}},HTTP.Servers.Server{Nothing,Sockets.TCPServer},Base.RefValue{Int64},Int64,Int64,Bool,HTTP.ConnectionPoo
l.Connection{Sockets.TCPSocket}})() at task.jl:356])
└ @ HTTP.Servers G:\Program Settings\.julia\packages\HTTP\atT5q\src\Servers.jl:264


Closing Pluto... Restart Julia for a fresh session.

Have a nice day! �
      From worker 2:    fatal: error thrown and no exception handler available.
      From worker 2:    jl_mutex_unlock at /cygdrive/d/buildbot/worker/package_win64/build/src\locks.h:143 [inlined]
      From worker 2:    jl_task_get_next at /cygdrive/d/buildbot/worker/package_win64/build/src\partr.c:476
      From worker 2:    poptask at .\task.jl:704
      From worker 2:    wait at .\task.jl:712 [inlined]
      From worker 2:    task_done_hook at .\task.jl:442
      From worker 2:    jl_apply at /cygdrive/d/buildbot/worker/package_win64/build/src\julia.h:1690 [inlined]
      From worker 2:    jl_finish_task at /cygdrive/d/buildbot/worker/package_win64/build/src\task.c:198
      From worker 2:    start_task at /cygdrive/d/buildbot/worker/package_win64/build/src\task.c:717
      From worker 2:    InterruptException()

julia>

@fonsp
Copy link
Owner

fonsp commented Sep 1, 2020

Could you write the place where you pressed Ctrl+C inside the output?

@fonsp fonsp changed the title julia.exe using 100% of a core when idle Windows 7: julia.exe using 100% of a core when idle Sep 1, 2020
@Ummon
Copy link
Author

Ummon commented Sep 2, 2020

Could you write the place where you pressed Ctrl+C inside the output?

It was before the line Closing Pluto... Restart Julia for a fresh session.

@Ummon
Copy link
Author

Ummon commented Sep 3, 2020

It seems if I use plotly() instead of the default GR backend for Plots this behavior doesn't appear.

@fonsp
Copy link
Owner

fonsp commented Sep 3, 2020

Can you try Jupyter?

@fonsp
Copy link
Owner

fonsp commented Sep 14, 2020

@Ummon does this only happen in that particular notebook or for all notebooks?

@fonsp
Copy link
Owner

fonsp commented Sep 24, 2020

This is not a problem for Windows 7 in general, and it is impossible for me to debug, so let's close this for now.

@fonsp fonsp closed this as completed Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants