[YANGTOOLS-162] QName/SchemaPath object caching Created: 12/May/14 Updated: 10/Apr/22 Resolved: 06/Aug/14 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | ||
| Reporter: | Robert Varga | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Description |
|
A simply-booted SP Edition contains 271623 org.opendaylight.yangtools.yang.common.QName instances, which eat up 86911936 bytes of memory (26783936 with retained objects), making it the top org.opendaylight object. The second most favorite is org.opendaylight.yangtools.yang.model.api.SchemaPath, with 250099 instances, 6002376 bytes and 34274552 retained (this includes QNames). Heap analysis points at possible savings of about 13MB on duplicated strings. We now have an object cache API, which will clearly be useful for these objects. Implement the proper usage. Note that QNames are allocated from binding classes, so any strings retained in the cache have to be copies. |
| Comments |
| Comment by Robert Varga [ 21/May/14 ] |
| Comment by Robert Varga [ 16/Jun/14 ] |
|
Needs follow-up conversion of users to static factory methods next. |
| Comment by Robert Varga [ 28/Jul/14 ] |