[YANGTOOLS-1004] four new netconf mounts using same schema not sharing same compiled schema Created: 11/Jun/19  Updated: 21/Jun/19  Resolved: 13/Jun/19

Status: Resolved
Project: yangtools
Component/s: parser
Affects Version/s: 3.0.1, 2.1.10, 2.0.20
Fix Version/s: 2.1.11, 2.0.21, 3.0.3

Type: Bug Priority: Medium
Reporter: Jamo Luhrsen Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screen Shot 2019-06-10 at 9.40.44 PM.png    

 Description   

It seems that when simultaneously mounting up to four identical devices, they will all be
compiled and kept in memory even though they can share the same compiled yang models.

If you first add a single device and wait for it to be full connected (thus, compiled/mounted), the
remaining devices that are mounted will reuse the already compiled models.

Also, if you attempt to simultaneously mount 5+ devices, it's only the first four that are
duplicated and anything after the 4th will share.

This may be expected behavior, but with a large compiled schema, you can quickly create
a case where lots of heap is used and can get to an OOM condition.



 Comments   
Comment by Jamo Luhrsen [ 11/Jun/19 ]

attached is a screen shot from a profiler showing heap usage before and after mounting 4 devices
simultaneously. One device consume aprox 375MB heap, so after all four are mounted we end up
using 2GB+ of heap. Ideally, we would use just 375MB for the first connected device and share
it for the other 3 devices.

Comment by Jamo Luhrsen [ 13/Jun/19 ]

I've tested the change locally and it works as expected. Also pushed the relevant distro through a sanity netconf test and it was fine:

https://logs.opendaylight.org/releng/vex-yul-odl-jenkins-1/netconf-csit-1node-gate-callhome-only-sodium/11/

Generated at Wed Feb 07 20:54:55 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.