[Rd] Win 32-bit, stack size problem with third party software?

Thiele, Jan Christoph Jan-Christoph.Thiele at forst.uni-goettingen.de
Tue Jan 8 17:44:00 CET 2013

Dear R-developers,

since R 2.15.2 I’m getting an error with my RNetLogo package.

The package uses rJava and connects to the Java program NetLogo

When starting it in so-called GUI-mode, i.e.: 

NLStart("C:/Program Files/NetLogo 5.0.3", gui=T)  #replace the path with the
path to your NetLogo installation directory

on a 32-bit Windows (Vista) system, I’m getting the following error message:

java.lang.OutOfMemoryError: unable to create new native thread

This happens when running it in the RGUI as well as in a MS-DOS prompt. 
The error doesn’t happen on a 64-bit Windows 7 system. 
It also doesn’t happen when I start it from RStudio (version 0.97.248, with R
2.15.2) or from JGR. 
With R 2.15.1 it worked without a problem even with RGUI and MS-DOS prompt.
rJava version is always the same.

I saw that the C stack size was increased with R 2.15.2:
"On Windows, the C stack size has been increased to 64MB (it has been 10MB
since the days of 32MB RAM systems)."
Furthermore, I found a discussion for RStudio which looks very similar to me:

I checked the C stack size with Cstack_info() and saw that 
in the RGUI 2.15.2 it is 67108864, 
in the RGUI 2.15.1 it was 10485760 
and in RStudio using R 2.15.2 it is 20971520.

Maybe also this message is related: 

Am I’m right that the problem is related to the increase in C stack size?
Is there a (easy) way to fix the problem with my package or have I refer the
users of my package to RStudio or JGR?

Any help is much appreciated.
Many thanks.

Best wishes,


Jan C. Thiele
Department of Ecoinformatics, Biometrics & Forest Growth
Faculty of Forest Sciences and Forest Ecology
University of Goettingen

Buesgenweg 4
37077 Goettingen

More information about the R-devel mailing list