how to release the memory on android

Issue #167 closed
Former user created an issue

hello, my friend, when I caculate the method(factorial(200000000)) in andorid phone, it will need a lot of memory, and the memory can not be released after timeout exception .then I caculate again, and it continue to increase memory. I calculate some formula and it will throw the timeout exception after calculating 5 seconds, when throwing the timeout exception, I want to release the memory. How do I release?

Comments (2)

  1. Axel Kramer repo owner

    Which timeout mechanism do you use?

    Do you use ExprEvaluator#evaluateWithTimeout() method?

    For multi thread environments it may be necessary to call EvalEngine.remove() to remove the ThreadLocal.

                try { 
                    // evaluate.....
                } finally {
                    EvalEngine.remove();
                }
    
  2. Log in to comment