Seemingly random Java error; batch IK with matlab

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Rebecca Lambach
Posts: 4
Joined: Tue Oct 07, 2014 1:24 pm

Seemingly random Java error; batch IK with matlab

Post by Rebecca Lambach » Fri Dec 08, 2017 3:31 pm

Hi forum readers!

I'm attempting to batch process some IK trials using matlab (2015a and OpenSim 3.3, both 64 bit), which I've done several times in the past and don't recall having any trouble, but I'm now receiving a sporadic java error. Sometimes the error occurs on the first trial processed, sometimes the 2nd, or 3rd, etc. and sometimes not at all. It's all over the place and the unpredictability is driving me crazy!

The Java error displayed in matlab is:

Code: Select all

Java exception occurred:
 
java.io.IOException: InverseKinematicsTool Failed, please see messages window for details...
 
     at org.opensim.modeling.opensimModelJNI.InverseKinematicsTool_run(Native Method)
 
     at org.opensim.modeling.InverseKinematicsTool.run(InverseKinematicsTool.java:137)
And when I check the out.log file, the error is: "InverseKinematicsTool Failed: bad allocation"

After searching the forum, it sounds like this could be a Java memory error. Does this sound familiar to anyone? Anybody have any ideas on how to correct the problem, work around it, or at least predict when it will happen? For now I just keep re-running the batch file (without changing anything!) until it works successfully, but it's pretty frustrating and I'm not happy with that 'solution'. Also, occasionally matlab crashes (Fatal Error warning forcing matlab to close) rather than returning the Java error, also with no predictability.

Thanks!
Becky

User avatar
Rebecca Lambach
Posts: 4
Joined: Tue Oct 07, 2014 1:24 pm

Re: Seemingly random Java error; batch IK with matlab

Post by Rebecca Lambach » Tue Dec 12, 2017 4:00 pm

Update, in case someone else stumbles upon this post because they have a similar error:

It seems like the error was actually related to a file reading/writing issue. I've been able to correct it by
1) Making sure the folder of trc files contains only trc files that I want to process and
2) Clearing out old setup files and ikResults files from the folders that are used by my batch processing code (speculation, but I think the setup files were more of an issue than the ikResults)

I'm not sure exactly what caused or solved the problem, and I'm not going to go back to try to test it out, I'm just happy that a little housecleaning seems to have done the trick.

My takeaway from this is that the "InverseKinematicsTool Failed: bad allocation" does not necessarily mean that there's a complicated Java memory error. My first step from now on will be to make sure no old/unwanted files are preventing the new/correct files from being read or written by my batch processing code.

Hope this helps someone else in the future!

POST REPLY