{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Setting the JVM Heap and other parameters\n", "Java allows you to configure the maximum heap size and various other settings with command line parameters when the JVM is started. BeakerX allows you to add parameters to the JVM with environment variables.\n", "For example, before you start Juptyer run\n", "```\n", "export beakerx_groovy_java_arg=-Xmx6g\n", "```\n", "And then when the Groovy kernel is started, it will have a 6GB maximum heap instead of the default. For an other JVM language, just substitute its name for \"groovy\". If you want to add more than one argument, then give the extras numbers, like `beakerx_groovy_java_arg2=-Dmyproperty=100`.\n", "\n", "A UI in the notebook instead of environment variables is on the [agenda](https://github.com/twosigma/beakerx/issues/5678)." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5.726797824" ] }, "execution_count": 1, "metadata": {}, "output_type": "execute_result" } ], "source": [ " Runtime.getRuntime().maxMemory()/1e9" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "100" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "System.getProperty(\"myproperty\")" ] } ], "metadata": { "beakerx_kernel_parameters": {}, "kernelspec": { "display_name": "Groovy", "language": "groovy", "name": "groovy" }, "language_info": { "codemirror_mode": "groovy", "file_extension": ".groovy", "mimetype": "", "name": "Groovy", "nbconverter_exporter": "", "version": "2.4.3" } }, "nbformat": 4, "nbformat_minor": 2 }