Problem cast MWBuiltInArray to MWNumericArray

Hi,
I have trouble using the MCR with Java. I have a function that I call every 40 seconds that works fine for about 39 hours and suddenly I get this error message:
java.lang.ClassCastException: com.mathworks.toolbox.javabuilder.MWBuiltinArray cannot be cast to com.mathworks.toolbox.javabuilder.MWNumericArray
Every single time I try to access the function after it first failed I get the same message and after some more hours the whole software just stops.
This error appears when I try to access the output list of the function:
this.flag = ((MWNumericArray) output.get(0)).getDouble();
The value I try to access is initialized at 0 and under certain circumstance can become 1. No other value is possible.
My function usually takes 1000ms-ish to process but when it first fails it lasted for around 500~600ms and then it seems it doesn't go to the function anymore as it spends less than 1ms in it.
Does anyone have an idea why would that be?

2 件のコメント

Walter Roberson
Walter Roberson 2012 年 12 月 26 日
Memory leak? Or just plain too big an array at that point? What size is your java heap set to?
Côme
Côme 2012 年 12 月 26 日
All the datas I use are alike. they're all the same size. I've tryed using the function unitarily on a set of data that failed it works fine so it seems it is because it was running for too long. If it was a memory leak I doubt it would be so precise it's always exacly afetr the same amout of time. I set the heap size at 1Go but other operations are performed by the software so it doesn't mean anything. Furthermore I don't keep the MCR open, I close it every single time I call it.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB Compiler SDK についてさらに検索

タグ

質問済み:

2012 年 12 月 26 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by