tools.nrepl

set stack size for Android

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: 0.0.5
  • Fix Version/s: 0.2.0-beta9
  • Component/s: None
  • Labels:
  • Environment:
    Android

Description

If you want to use nREPL on Android (currently only possible with sattvik's fork of Clojure) then you need bigger stack sizes than Android's default 8k to eval even moderately complex expressions. For comparison: A regular JVM on a PC has default stack sizes around 256k ... 512k depending on platform.

In nrepl.clj, modify

(doto (Thread. r)
(.setDaemon true))))))

to read

(doto (Thread. (.getThreadGroup (Thread/currentThread)) r "nREPL" 524288) ; 512k generous stack size
(.setDaemon true))))))

Note: There are warnings here http://bit.ly/u86tF1 about choosing a good stack size but since in practice nREPL seems to have <10 threads running with 1 active client connection we can be generous here.

The more advanced version would be to make this somehow configurable but that'd probably be over-engineering things.

Activity

Chas Emerick made changes -
Field Original Value New Value
Resolution Declined [ 2 ]
Status Open [ 1 ] Resolved [ 5 ]
Chas Emerick made changes -
Status Resolved [ 5 ] Reopened [ 4 ]
Resolution Declined [ 2 ]
Chas Emerick made changes -
Fix Version/s 0.2.0-beta9 [ 10151 ]
Chas Emerick made changes -
Fix Version/s 0.2.0-beta9 [ 10151 ]
Chas Emerick made changes -
Resolution Completed [ 1 ]
Fix Version/s 0.2.0-beta9 [ 10151 ]
Status Reopened [ 4 ] Closed [ 6 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: