Quantcast
Channel: R.NET
Viewing all articles
Browse latest Browse all 1634

Closed Issue: RDotNet.ParseException & Erro: C stack usage is too close to the limit with WCF [19]

$
0
0
I can start the server and successfully call GetData(int value) multiple times. If I the call to the server in a loop I can call it forever. However, if I don't call it for 5 minutes or so and then try calling it I get Error: C stack usage is too close to the limit. Possible thoughts was memory leak or garbage collection.

Here is my server:
static REngine engine = null;
static RService()
{
// Set the folder in which R.dll locates.
REngine.SetDllDirectory(@"C:\Program Files\R\R-2.13.1\bin\i386");
engine = REngine.CreateInstance("RDotNet");
}

public string GetData(int value)
{
// .NET Framework array to R vector.
NumericVector group1 = engine.CreateNumericVector(new double[] { 30.02, 29.99, 30.11, 29.97, 30.01, 29.99 });
engine.SetSymbol("group1", group1);
// Direct parsing from R script.
NumericVector group2 = engine.EagerEvaluate("group2 <- c(29.89, 29.93, 29.72, 29.98, 30.02, 29.98)").AsNumeric();

// Test difference of mean and get the P-value.
GenericVector testResult = engine.EagerEvaluate("t.test(group1, group2)").AsList();
double p = testResult["p.value"].AsNumeric().First();

String retString = "";
retString += String.Format("Group1: [{0}]", string.Join(", ", group1)) + "\n";
retString += String.Format("Group2: [{0}]", string.Join(", ", group2)) + "\n";
retString += String.Format("P-value = {0:0.000}", p);
return retString;
}
Comments: The latest code disable C stack checking. This is not possible to fully check whether this overcomes the issue as reported. This is bound to be re-reported if still an issue.

Viewing all articles
Browse latest Browse all 1634

Trending Articles