필터 지우기
필터 지우기

Invalid or deleted object error after long run in App Designer

조회 수: 8 (최근 30일)
Dominique
Dominique 2024년 3월 14일
댓글: Dominique 2024년 3월 21일
Please see attached file MSG_5.mlapp developped in App Designer. It just calculates numbers and save solutions in a file.
It is supposed to run for given duration (seconds, minutes, hours, and days). Ideally, it must keep on calculating for 20 days.
All seems well on short runs, i.e upto 15 hours. However, on long runs, i.e 17, 20, 27 hours, the code crashes in line 3282.
I can't figure out why the error Invalid or deleted object erupts suddenly after as duration goes on.
To operate this App:
  1. Click Reference Data button to uphold input data. See attached file MSG_4_Quintuplets_Table_NonZero.mat. Do not rename.
  2. Set duration and unit
  3. and Click on AUTOMATE button
When a solution is detected, the App generates a file called MSG_5_solutions_level_1.mat and saves the solution in it.
I will really appreciate if somebody helps me debug this error.
Thanks
  댓글 수: 2
Cris LaPierre
Cris LaPierre 2024년 3월 18일
Is there more to the error messgae? Please share all the red text.
Dominique
Dominique 2024년 3월 19일
편집: Dominique 2024년 3월 19일
Hi @Cris LaPierre, here is the snippet of the error message:
Invalid or deleted object.
Error in MSG_5/AUTOMATEButtonPushed (line 3282)
current_height_level1 = height(app.solution_matrix);
Error in matlab.apps.AppBase>@(source,event)executeCallback(ams,app,callback,requiresEventData,event) (line 62)
newCallback = @(source, event)executeCallback(ams, ...
Error while evaluating DestroyedObject PrivateButtonPushedFcn.

댓글을 달려면 로그인하십시오.

채택된 답변

Shivam
Shivam 2024년 3월 20일
I understand that you are dealing with a long-running app that leads to a crash when the app's running time goes beyond 15 hours.
Upon reviewing the error and the amount of time the app runs, I find the memory issue in this case. (I ran the app for around an hour, which didn't lead to any crashes). It is important to note that long-running applications performing calculations and data manipulations can consume increasing amounts of memory over time. And, when the system starts running low on memory, it might start behaving unpredictably, which can lead to data loss (here, the app object getting deleted).
While there may not be a single solution to this issue, I have outlined a few recommendations that could help identify and resolve the problem:
  • Debug the app by checking before line 3282, confirming if the app object is still in the MATLAB workspace.
  • Ensure that no part of the code explicitly deletes or clears the object associated with app.solution_matrix. This includes using delete, clear, or close functions in the code. Also, check if the app object handle is not overwritten.
  • Monitor the application's memory usage over time to see if there is a memory leak/memory leak spike before the crash. You can use the MATLAB profile command to start profiling the session, which can help identify memory usage.
You can refer to the following MATLAB answer to know more about profiling MATLAB memory usage:
I hope it addresses your query.
Thanks
  댓글 수: 1
Dominique
Dominique 2024년 3월 21일
Thank you very much for taking time to check this issue.
I'm going to investigate it using MATLAB Profiling.
Thanks.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by