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

heap exhausted error on Maxima/Jupyter, but not Maxima #44

Open
powerline332 opened this issue Dec 14, 2018 · 1 comment
Open

heap exhausted error on Maxima/Jupyter, but not Maxima #44

powerline332 opened this issue Dec 14, 2018 · 1 comment

Comments

@powerline332
Copy link

Hello,

I followed instructions exactly (using Method 1 with --user installation) on the website;

https://github.com/robert-dodier/maxima-jupyter

to install Maxima/Jupyter. I already had a working version of Maxima and Maxima with Emacs & Slime.

My sbcl & maxima are new (from git):

sbh@sbh ~/SW/SBCL/git/sbcl-sbcl $ maxima --version
Maxima branch_5_42_base_262_g466b8f231_dirty
sbh@sbh ~/SW/SBCL/git/sbcl-sbcl $ ~/SW/SBCL/git/here/
bin/ lib/ share/
sbh@sbh ~/SW/SBCL/git/sbcl-sbcl $ ~/SW/SBCL/git/here/bin/sbcl --version
SBCL 1.4.14.113-cf1106354-dirty

I have the problem with dynamic-space-size, well heap exhaustion - I think it
is almost the same thing... Is it Jupyter? Python?

Here is my python3;

sbh@sbh ~/SW/MaximaJupyter $ sudo apt-cache policy python3
python3:
Installed: 3.5.1-3
Candidate: 3.5.1-3
Version table:
*** 3.5.1-3 500
500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages
100 /var/lib/dpkg/status

and I just reinstalled jupyter as well (see below).

This is my prep work to install jupyter/maxima (had to start with an apt-get for pip);

The following additional packages will be installed:
libczmq3 libexpat1-dev libpython3-dev libpython3.5-dev libzmq3-dev
python-pip-whl python3-dev python3-setuptools python3-wheel python3.5-dev
Suggested packages:
python-setuptools-doc
The following NEW packages will be installed:
libczmq-dev libczmq3 libexpat1-dev libpython3-dev libpython3.5-dev
libzmq3-dev python-pip-whl python3-dev python3-pip python3-setuptools
python3-wheel python3.5-dev
0 upgraded, 12 newly installed, 0 to remove and 4 not upgraded.

python3 -m pip install --upgrade pip
python3 -m pip install jupyter

cd /home/sbh/SW/MaximaJupyter/

git clone https://github.com/robert-dodier/maxima-jupyter.git

cd maxima-jupyter

rlwrap /home/sbh/SW/Maxima/git/execprefix/bin/maxima

:lisp ( load "/home/sbh/SW/MaximaJupyter/maxima-jupyter/load-maxima-jupyter.lisp" )

:lisp ( sb-ext:save-lisp-and-die #P"/home/sbh/SW/MaximaJupyter/maxima-jupyter-exec" :executable t :toplevel 'maxima-jupyter:kernel-start-exec)

ls ..

python3 ./install-maxima-jupyter.py --exec=/home/sbh/SW/MaximaJupyter/maxima-jupyter-exec --user

I have 16GB of memory installed, here is my inxi (linux mint);

sbh@sbh ~/SW/SBCL/git/sbcl-sbcl $ inxi -F
System: Host: sbh Kernel: 4.15.0-38-generic x86_64 (64 bit)
Desktop: Cinnamon 3.6.7
Distro: Linux Mint 18.3 Sylvia
Machine: System: Apple (portable) product: MacBookPro11 3 v: 1.0
Mobo: Apple model: Mac-2BD1B31983FE1663 v: MacBookPro11 3
Bios: Apple v: MBP112.88Z.0146.B00.1804111138 date: 04/11/2018
CPU: Quad core Intel Core i7-4980HQ (-HT-MCP-) cache: 6144 KB
clock speeds: max: 4000 MHz 1: 2139 MHz 2: 1266 MHz 3: 1323
MHz 4: 1698 MHz 5: 1596 MHz 6: 1607 MHz
7: 1262 MHz 8: 1753 MHz
Graphics: Card: NVIDIA GK107M [GeForce GT 750M Mac Edition]
Display Server: X.Org 1.18.4 drivers: nvidia (unloaded:
fbdev,vesa,nouveau)
Resolution: [email protected]
GLX Renderer: GeForce GT 750M/PCIe/SSE2 GLX Version: 4.5.0
NVIDIA 384.130
Network: Card: Broadcom BCM4360 802.11ac Wireless Network Adapter
driver: wl
IF: wlp3s0 state: up mac: 24:a0:74:f2:c5:4a
Drives: HDD Total Size: 2000.8GB (60.5% used) ID-1: /dev/sda model:
APPLE_SSD_SM1024 size: 1000.6GB
ID-2: USB /dev/sdc model: FreeAgent_GoFlex size: 1000.2GB
Partition: ID-1: / size: 202G used: 171G (90%) fs: ext4 dev: /dev/sda8
ID-2: swap-1 size: 26.21GB used: 25.22GB (96%) fs: swap
dev: /dev/sda9
RAID: No RAID devices: /proc/mdstat, md_mod kernel module present
Sensors: System Temperatures: cpu: 70.0C mobo: N/A gpu: 69C
Fan Speeds (in rpm): cpu: N/A
Info: Processes: 314 Uptime: 6 days Memory: 11089.0/15949.0MB
Client: Shell (bash) inxi: 2.2.35

Here is an error spit out onto terminal when the 'kernel dies' in Jupyter/Maxima;

[I 15:38:57.834 NotebookApp] Saving file at /Unknot Local.ipynb
Heap exhausted during garbage collection: 0 bytes available, 32 requested.
Gen Boxed Unboxed LgBox LgUnbox Pin Alloc Waste
Trig WP GCs Mem-age
0 2276 296 0 0 14 84197616 81680
41187626 2572 1 0.0000
1 3273 1259 0 0 40 148386608 117968
10737418 4532 0 1.2657
2 2989 1516 0 0 21 147540416 79424
10737418 4505 0 0.0000
3 8592 949 0 0 47 312465264 174224
10737418 9541 0 0.5945
4 4567 404 0 0 32 162813104 76624
10737418 4971 0 0.0000
5 4466 241 0 0 53 154067648 171328
2000000 4707 0 0.0000
6 1122 573 113 132 0 61589296 1980624
2000000 1940 0 0.0000
7 0 0 0 0 0 0 0
2000000 0 0 0.0000
Total bytes allocated = 1071059952
Dynamic-space-size bytes = 1073741824
GC control variables:
GC-INHIBIT = true
GC-PENDING = true
STOP-FOR-GC-PENDING = false
fatal error encountered in SBCL pid 4730(tid 0x7f3377160700):
Heap exhausted, game over.

Welcome to LDB, a low-level debugger for the Lisp runtime environment.
Error opening /dev/tty: No such device or address
ldb> [I 15:42:33.639 NotebookApp] KernelRestarter: restarting kernel
(1/5), keep random ports

also...I didn't put maxima on the path, but have a bash alias for it.

I have seen similar questions on the web for users with ccl having much more dynamic space size, around 4GB, yet mine seems to remain at the hard-coded limit in sbcl's genesis,

sbh@sbh ~/ResearchWC $ grep -rnw ~/SW/SBCL/ -e "1073741824"
/home/sbh/SW/SBCL/git/sbcl-sbcl/output/genesis-2/constants.h:206:#define
DEFAULT_DYNAMIC_SPACE_SIZE 1073741824 /* 0x40000000 /
/home/sbh/SW/SBCL/git/sbcl-sbcl/tests/float.pure.lisp:393: (assert (=
(round 1073741823.5d0) 1073741824))
/home/sbh/SW/SBCL/git/sbcl-sbcl/tests/float.pure.lisp:394: (assert (=
(round 1073741823.7d0) 1073741824)))
/home/sbh/SW/SBCL/git/sbcl-sbcl/src/runtime/genesis/constants.h:206:#define
DEFAULT_DYNAMIC_SPACE_SIZE 1073741824 /
0x40000000 */

I do edit the file 'maxima' to add more dynamic space but seems to have no affect on the crash message,

if [ -x "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" ]; then
exec "$MAXIMA_IMAGESDIR/binary-$MAXIMA_LISP/maxima" --noinform $MAXIMA_LISP_OPTIONS --dynamic-space-size 4096 --control-stack-size 1024 --end-runtime-options --eval '(cl-user::run)' --end-toplevel-options "$@"
else
exec "/home/sbh/SW/SBCL/git/here/bin/sbcl" --core "$maxima_image_base.core" --noinform $MAXIMA_LISP_OPTIONS --dynamic-space-size 4096 --control-stack-size 1024 --end-runtime-options --eval '(cl-user::run)' --end-toplevel-options "$@"
fi

@robert-dodier
Copy link
Owner

Thanks for the info. I don't have a clear idea about what's going on, but let me ask some questions in hope of narrowing it down.

What came before the crash? Were you in a working Maxima session in which some stuff was working OK and then it crashed? If so what was the last thing you did in the Maxima session? What is the terminal output where you are running jupyter?

If you were working in a Maxima session and it crashed, what happens if you try the same operations with ordinary maxima?

Can you post your notebook file "Unknot Local.ipynb"? If so I will try to run it on my system.

I see that the console log seems to show that jupyter was trying to save your notebook and then it crashed. I can't tell if the one immediately followed the other, or if there was some time elapsed between them.

About maxima being in the path or not, it shouldn't matter. maxima-jupyter is the executable and it doesn't try to execute ordinary maxima.

Sorry I can 't be more helpful yet.

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