Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leaks when changing tabs #4484

Closed
tjmurray opened this issue Aug 23, 2023 · 4 comments
Closed

Memory leaks when changing tabs #4484

tjmurray opened this issue Aug 23, 2023 · 4 comments
Assignees
Labels
user issue An issue or bug reported by users.
Milestone

Comments

@tjmurray
Copy link

Are you requesting a feature, reporting a bug or ask a question?

Bug - memory leak

What is the current behavior?

Every time you switch tabs in the survey creator, e.g. back and forth between 'Designer' tab and 'Preview' tab, the app leaks memory continuously after every change. My current tab where I have been editing a form is using over 1GB of memory due to this leak. Other tabs ('Logic' and 'JSON Editor') may also be affected but I am not sure.

What is the expected behavior?

No memory leak when switching tabs.

How would you reproduce the current behavior (if this is a bug)?

Create a form of decent length (the higher the form length/complexity, the higher the memory leaking), then while in the survey creator, open Chrome memory profiler and observe the memory leak accumulate as you toggle back and forth between 'Designer' tab and 'Preview' tab. Toggle quickly back and forth to see the memory rise especially quickly.

Provide the test code and the tested page URL (if applicable)

Tested page URL: No public URL available

Test code: for brevity I have included only a short/simple form example below, but this issue gets dramatically worse with larger forms. With this example you should see the memory leak by a few MB every time the tab is toggled, but for a larger form it is 10s of MBs.

{
 "title": "Application for Leave",
 "description": "Apply for leave for maternity, study, medical, etc",
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "text",
     "name": "start_date",
     "title": "Start date requested",
     "isRequired": true,
     "inputType": "date"
    },
    {
     "type": "text",
     "name": "end_date",
     "title": "End date requested",
     "isRequired": true,
     "inputType": "date"
    },
    {
     "type": "dropdown",
     "name": "reason",
     "title": "Reason for leave",
     "isRequired": true,
     "choices": [
      {
       "value": "Item 2",
       "text": "Maternity"
      },
      {
       "value": "Item 3",
       "text": "Study"
      },
      {
       "value": "Item 4",
       "text": "Medical"
      }
     ],
     "showOtherItem": true,
     "otherPlaceholder": "Please specify"
    },
    {
     "type": "comment",
     "name": "additional_details",
     "title": "Any additional details/information (optional)"
    },
    {
     "type": "file",
     "name": "supporting_doc",
     "title": "Any supporting document"
    }
   ]
  }
 ]
}

Specify your

  • browser: Chrome
  • editor version: 1.9.100

Screenshot of issue

Screenshot of Chrome profiler after toggling tabs ~100 times. Started at ~20MB and ended at 377MB:

Screenshot 2023-08-23 at 14 19 05
@JaneSjs JaneSjs self-assigned this Aug 23, 2023
@JaneSjs
Copy link
Contributor

JaneSjs commented Aug 23, 2023

Hello @tjmurray,
Thank you for contacting us and thank you for sharing a survey JSON. To help me reproduce the issue quicker, would you please specify your JavaScript development platform?

@JaneSjs JaneSjs added the user issue An issue or bug reported by users. label Aug 23, 2023
@tsv2013 tsv2013 self-assigned this Aug 24, 2023
@JaneSjs JaneSjs removed their assignment Aug 24, 2023
@tjmurray
Copy link
Author

Vue 3

@tsv2013
Copy link
Member

tsv2013 commented Aug 25, 2023

Unfortunately there is no SurveyJS Creator for Vue3. Could you please check - what survey-creator library are you using and what is the version of this library?

@tjmurray
Copy link
Author

"survey-creator-knockout": "1.9.100",
"survey-knockout-ui": "1.9.100",

tsv2013 added a commit to surveyjs/survey-library that referenced this issue Aug 29, 2023
tsv2013 added a commit to surveyjs/survey-library that referenced this issue Aug 29, 2023
tsv2013 added a commit to surveyjs/survey-library that referenced this issue Aug 29, 2023
tsv2013 added a commit to surveyjs/survey-library that referenced this issue Aug 29, 2023
tsv2013 added a commit to surveyjs/survey-library that referenced this issue Aug 29, 2023
tsv2013 pushed a commit to surveyjs/survey-library that referenced this issue Aug 30, 2023
tsv2013 pushed a commit to surveyjs/survey-library that referenced this issue Aug 30, 2023
tsv2013 pushed a commit to surveyjs/survey-library that referenced this issue Aug 30, 2023
tsv2013 pushed a commit that referenced this issue Aug 30, 2023
tsv2013 pushed a commit to surveyjs/survey-library that referenced this issue Sep 1, 2023
tsv2013 pushed a commit to surveyjs/survey-library that referenced this issue Sep 4, 2023
andrewtelnov added a commit to surveyjs/survey-library that referenced this issue Sep 4, 2023
tsv2013 pushed a commit to surveyjs/survey-library that referenced this issue Sep 4, 2023
tsv2013 pushed a commit that referenced this issue Sep 4, 2023
OlgaLarina added a commit to surveyjs/survey-library that referenced this issue Sep 4, 2023
@OlgaLarina OlgaLarina added this to the v1.9.106 milestone Sep 5, 2023
tsv2013 pushed a commit that referenced this issue Sep 5, 2023
tsv2013 pushed a commit that referenced this issue Sep 5, 2023
@RomanTsukanov RomanTsukanov changed the title Memory leak when changing tabs within Survey Creator Memory leaks when changing tabs Sep 5, 2023
tsv2013 pushed a commit that referenced this issue Sep 5, 2023
OlgaLarina pushed a commit that referenced this issue Sep 5, 2023
* Resolved #4484 - memory leaks in survey creator

* Work for #4484 - memory leaks in survey creator

* Resolved #4484

* Work for #4484 - fixed leaks in Angular

* Fixed lint

* Work for #4484 - fixed f-tests in react

* Work for #4484 - fixed f-tests in knockout

* Work for #4484 - fixed f-test - test tab for mobile devices

* Work for #4484 - dispose theme tab model

---------

Co-authored-by: tsv2013 <tsv2013@noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user issue An issue or bug reported by users.
Projects
None yet
Development

No branches or pull requests

4 participants