Treegrid page Memory usage and crash problem

I need to render a treegrid with 50k+ rows on virualScroll mode and works on both PCs and Mobiles.
There's an official snippet I get from another Issue: https://stackblitz.com/edit/angular-959stf?file=app.component.ts,app.component.html , and it doesn't have any complex feature.

On most PCs, it works fine, but on iPhone13 safari, it opens up, but after some while, the page turn white and crash with a message "a problem repeatedly occurred" which user haven't done anything, I think it's due to safari memoryLimit, so I test it on these platforms:

System: Android, ios(15+ A15), ipadOS(15+ M1)
Brand:  any..., Apple

On most recent Android Devices, it open up fine (M1 ipad safari unable to open up), but my requirements need some more detailed functionality like:

      custom template: each cell inside every row may render as a DropDownList or Checkbox

      column dom element toggle: each cell under a column turn on/off selectRow checkbox and it display/hide 

These requirements above add up to massive memory usage and performance interference,  when I interact on page-success-rendered Android devices, these pages crash as well. 
What's more, not just system preinstalled browser, we may also need it to run on some app built-in webview, these scenes may come with more strict memoryLimitation.

I wonder if there's any solution.


Attachment: 20220808_09.49.35.mp4_3b62e5ba.zip

6 Replies 1 reply marked as answer

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team August 4, 2022 03:08 PM UTC

Hi NieChen,


We have checked your reported issue from your provided sample in iPhone13 safari, but TreeGrid has been rendered properly. Refer to the screenshot below:-


Sample link with Latest version:- https://stackblitz.com/edit/angular-gyr554-cd6y1h?file=app.component.html



We have checked the reported problem with latest version. So please ensure the issue with above sample link.


Also we need some more additional details to find the cause of the issue. Share us the following details.


  1. Have you faced the issue on Rendering of TreeGrid or performing any actions.
  2. Share detailed explanation of the scenario in which you have faced the issue.
  3. TreeGrid package version details.



Regards,

Farveen sulthana T



NI NieChen replied to Farveen Sulthana Thameeztheen Basha August 5, 2022 09:44 AM UTC

Thanks for reply!

    I checked the snippet you new provide, it does open on iPhone13,  noticing that I forget to mention that my data structures are in Self-Referential mode with 3 level, sorry about that!🙏🏻

   The treegrid package I was using was 20.2.36,  now I have updated it to 20.2.40, still facing the problem, wok on PC, but crash on IOS, after analysising the page memory timeline, the max point shall be located at the treegrid data render point


   since my 50k+ data is a flat array with Self-Referential records, it looks like this, linking through "rowid"=>selfNode,
"pid"=> parentNode ( parent's rowid )

the component shall auto generate the flat array to hierarchy structure and there's a loop function called convertToFlatData, maybe this step or at this point beforeAfter is costing too much memory? And I found the treegrid refresh method call this step as well ( I didn't call refresh at page render point, I mean this may explain why some  Android Device opens fine but after actions still crash ), my treegrid datasouce is passing by direct assign from an Ajax request response


Again, thanks for helping with my problem!



NI NieChen replied to Farveen Sulthana Thameeztheen Basha August 8, 2022 03:31 AM UTC

Here's a json file of all my row datas, Please checkout.
And my columns are generated from a loop.


Attachment: rows.json_d7b77b7c.zip


FS Farveen Sulthana Thameeztheen Basha Syncfusion Team August 8, 2022 02:40 PM UTC

Hi NieChen,


We have prepared sample as like (Self-reference structure with 50K+ records) but we are unable to replicate the problem at our end(TreeGrid renders properly). Refer to the sample link:-

https://stackblitz.com/edit/angular-gyr554-5tuax7?file=app.component.html


Screenshot:- (From IPhone)



IPad Safari:-


We need some more additional details to find the cause of the issue. Share us the following details.


  1. Complete TreeGrid code details.(both app.component.ts)
  2. Have you enabled Virtualization for TreeGrid or have you faced the issue after enabling Virtualization?
  3. Share Video demo to replicate the issue.(In IOS device)
  4. Have you faced this Performance Issue on enabling any specific properties?
  5. If possible replicate it in the above sample and revert us back(with Video Demo).


Regards,
Farveen sulthana T



NI NieChen replied to Farveen Sulthana Thameeztheen Basha August 11, 2022 03:25 AM UTC

Glad to tell, my problem solved!


My treegrid has the feature to add new Columns and the row field mapping is from the column headerText,
so 50k+ rows Object ,  for column "999",  each row has the object structure like obj{ '999':'someText', ......  } ,
refer to V8 engine Object key method, numeric keys consuming much more memory, https://jayconrod.com/posts/52/a-tour-of-v8-object-representation


So I should Just avoid setting row object filed to numeric keys, especially when 
demonstrating a big amount of datas,
Maybe consider adding this tip to the treegrid doc? 😁


Marked as answer

FS Farveen Sulthana Thameeztheen Basha Syncfusion Team August 13, 2022 09:27 AM UTC

Hi NieChen,


Thanks for your update. We will validate this case and will add this scenario in our TreeGrid documentation as per your suggestion. Please get back to us if you need any further assistance. We are happy to assist you further.


Regards,

Farveen sulthana T


Loader.
Up arrow icon