From Jan-Christoph.Thiele at forst.uni-goettingen.de  Tue Jan  8 17:44:00 2013
From: Jan-Christoph.Thiele at forst.uni-goettingen.de (Thiele, Jan Christoph)
Date: Tue, 8 Jan 2013 17:44:00 +0100
Subject: [Rd] Win 32-bit, stack size problem with third party software?
Message-ID: <99392551BB49ED458ACFE796416D31890214248F@VS3.exc.top.gwdg.de>

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
(http://ccl.northwestern.edu/netlogo/). 

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

library(RNetLogo) 
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:
http://support.rstudio.org/help/discussions/problems/4126-rstudio-v-and-v0963
31-running-with-rbbg

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: 
http://r.789695.n4.nabble.com/rJava-td4652659.html

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


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

Buesgenweg 4
37077 Goettingen
GERMANY



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