From e7803c07d674ddc0db6eeecd0386480307aae09c Mon Sep 17 00:00:00 2001 From: Raphael Roberts Date: Mon, 4 Nov 2019 16:54:30 -0600 Subject: [PATCH] Runs meghanada only if at least 512 mb of ram is free --- settings.org | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/settings.org b/settings.org index b729fec..a76cde9 100644 --- a/settings.org +++ b/settings.org @@ -96,8 +96,10 @@ This handy function is a customized ripoff of custom-save-all #+END_SRC ** Low memeory check #+BEGIN_SRC emacs-lisp - (defun rlbr/high-mem () (>= (nth 1 (memory-info)) - (expt 1024 2))) + (defun rlbr/high-mem (&optional threshold) + (let ((threshold (or threshold (expt 1024 2))))) + (>= (nth 1 (memory-info)) + threshold)) #+END_SRC ** Kill this buffer #+BEGIN_SRC emacs-lisp @@ -200,7 +202,7 @@ This handy function is a customized ripoff of custom-save-all :defer t) (use-package meghanada - :if (rlbr/high-mem) + :if (rlbr/high-mem (* 512 1024)) :defer t :init (add-hook 'java-mode-hook