SNL-WaterPower / siweed

Sandia Interactive Wave Energy Education Display (SIWEED)
5 stars 2 forks source link

GUI Usage #66

Closed SeanPluemer closed 3 years ago

SeanPluemer commented 3 years ago

The CPU usage will spike to ~100% after 4-5 min of idle use. It will also return the following error:

java.lang.ArrayIndexOutOfBoundsException: 36526
    at processing.data.Table.setString(Table.java:3535)
    at processing.data.Table.setFloat(Table.java:3284)
    at processing.data.Table.setFloat(Table.java:3300)
    at processing.data.Table$RowPointer.setFloat(Table.java:2782)
    at siWeedGUI.logData(siWeedGUI.java:1590)
    at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at processing.core.PApplet.method(PApplet.java:3867)
    at processing.core.PApplet$2.run(PApplet.java:3905)

I will update other things I find.

nickross4444 commented 3 years ago

After fixing the bugs in issue 73, the cpu usage and the array index this issue is fixed.

The memory leak(which also caused a slow declining framerate) was caused by the data logging. I've added a flag at the top of the program(along with GUI console and debug mode) that allows data logging to be turned off and on. It can run on at full performance for at least 5 minutes or so, so I figured this is fine for our uses. I do not yet know how to completely fix the leak, so we can just turn of data logging during normal operation. @ryancoe @dforbush2, What do you think of this?

Good news is now the GUI seems to run stably for an indefinite amount of time(on my laptop). Still needs testing on the miniWEC workstation PC and on other computers. @SeanPluemer, could you pull develop and test the stability?

ryancoe commented 3 years ago

Good bandaid I think for now. It will allow us to run our v1 tests, at which point we can reassess how to handle this.

nickross4444 commented 3 years ago

I've added some notes in the data logging tab to fix the leak. We'll have to spend some time restructuring how data is saved, but it should fix the issue.