Ask Your Question
1

Mouse Lag after a while

asked 2020-07-27 07:52:57 +0100

ortollj gravatar image

updated 2020-07-27 09:04:46 +0100

Hi

Ubuntu 18.04.4 LTS , FireFox 78.0.2 , SageMath Jupyter notebook 9.1

When I use my pc with SageMath, after a while I observe a high response time with my mouse. I then look at what is happening with the system monitor, and I see that the memory is occupied at around 90% and that the swap memory is occupied at around 35%. If I quit Sagemath (I meant that I kill the terminal window in which I launched SageMat without & I precise) and I close all Firefox windows, then the memory occupation goes down to around 60% and the swap memory goes down to around 25%. But when I look with HTOP, I notice that it is still running several Sagemath processes. I'll give it a try with Chrome, to see if it's browser independent. The problem is not specific to a certain SageMath code, I notice it with different SageMath codes. image description

edit retag flag offensive close merge delete

Comments

I will expand this post with different tests and details later. I don't have time today.

ortollj gravatar imageortollj ( 2020-07-27 08:50:22 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-07-28 12:40:57 +0100

slelievre gravatar image

updated 2020-07-28 12:49:32 +0100

Things to be aware of when using Jupyter notebooks:

  • a new Sage session gets launched for each Jupyter worksheet you open
  • closing the worksheet's browser tab does not terminate the corresponding session (reopen a worksheet and you can resume computing without having to run all cells again)

The good practice is to make sure to "Close and halt" each worksheet when done with it, as that will terminate the corresponding Sage session.

If you are using JupyterLab, the interface lets you more easily

  • spot which Jupyter workhseets still have an active kernel (ie associated Sage session).
  • stop those kernels one by one
  • or "stop all kernels"

To install JupyterLab if you haven't yet:

  • if you installed Sage with a package manager, use that package manager to install JupyterLab too
  • if you built Sage from source or installed binaries from the Sage download page, open a Sage session and type

        sage: !pip install jupyterlab
    

Then to use Sage in JupyterLab, run one of the following two commands in a terminal:

$ sage --jupyter lab
$ sage -n jupyterlab

Or if your system-wide Jupyter installation has Sage, this should work too

$ jupyter lab
edit flag offensive delete link more

Comments

Thank @slelievre, for all these operational details . Thank you for this advice to install Jupyter lab, I like this new interface

ortollj gravatar imageortollj ( 2020-07-29 06:39:52 +0100 )edit

but interact seems not to work in Jupyter Lab ;-( . moreover when I try to upvote the post:Interact in Jupyterlab vs Jupyter I got the mesage : sorry but older vote can't be revoked

[edited] Oops maybe that's because I already upvoted this post ? but I don't remember doing that !

O anger! O despair! O age my enemy!, Have I lived simply to know this infamy! ;-)

ortollj gravatar imageortollj ( 2020-07-29 07:24:05 +0100 )edit

Perhaps upgrade this post by moving from pip to pip3, since pip is not anymore in the distribution

Cyrille gravatar imageCyrille ( 2020-07-29 09:58:44 +0100 )edit

@Cyrille - If you're running the command with ! from inside Sage, pip should work in all cases.

slelievre gravatar imageslelievre ( 2020-07-29 13:50:25 +0100 )edit

@ortolij -

but interact seems not to work in Jupyter Lab ;-( . moreover when I try to upvote the post: Interact in Jupyterlab vs Jupyter I got the mesage : sorry but older vote can't be revoked [edited] Oops maybe that's because I already upvoted this post ? but I don't remember doing that !

If it says "older vote can't be revoked" when you try to upvote, it means you either upvoted or downvoted that post in the past (within a short time after upvoting, clicking "upvote" again cancels the upvote).

slelievre gravatar imageslelievre ( 2020-07-29 14:15:53 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-07-27 07:52:57 +0100

Seen: 323 times

Last updated: Jul 28 '20