Commit cf13898
authored
Include core instance sizes in component_instance_size limit (#12772)
* Include core instance sizes in component_instance_size limit
There exist several knobs for limiting the memory that might be consumed
for metadata for components. For core module instances within a
component, the two that previously existed to control metadata
allocations have been:
- A: max_core_instances_per_component
- B: component_instance_size
These allow for an embedder to set an upper bound on memory used by a
component's instances to A * B. This value could be quite large for
some systems and it would be nice to be able to set a cap on the total
memory that might be used for metadata across all instances while still
allowing for a greater number of instances with the potential for a
subset of those instances to be relatively large.
To allow for aggregate control over memory used within the runtime
for componenets, the existing `max_component_instance_size` limit
is extended to consider both the `VMComponentCtx` size as well as
the aggregate size of all core instances in the component.
* Fix err msg checks for component_instance_size_limit test
* Miri ignore component_core_instances_aggregate_size1 parent 133a0ef commit cf13898
3 files changed
Lines changed: 77 additions & 17 deletions
File tree
- crates/wasmtime/src
- runtime/vm/instance/allocator
- tests/all
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3650 | 3650 | | |
3651 | 3651 | | |
3652 | 3652 | | |
3653 | | - | |
| 3653 | + | |
| 3654 | + | |
3654 | 3655 | | |
3655 | 3656 | | |
3656 | 3657 | | |
| |||
3667 | 3668 | | |
3668 | 3669 | | |
3669 | 3670 | | |
| 3671 | + | |
| 3672 | + | |
| 3673 | + | |
| 3674 | + | |
| 3675 | + | |
| 3676 | + | |
3670 | 3677 | | |
3671 | 3678 | | |
3672 | | - | |
3673 | | - | |
| 3679 | + | |
| 3680 | + | |
| 3681 | + | |
3674 | 3682 | | |
3675 | 3683 | | |
3676 | 3684 | | |
| |||
Lines changed: 16 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
| 103 | + | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
474 | 474 | | |
475 | 475 | | |
476 | 476 | | |
| 477 | + | |
477 | 478 | | |
478 | | - | |
479 | | - | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
480 | 482 | | |
481 | 483 | | |
482 | 484 | | |
483 | 485 | | |
484 | 486 | | |
485 | 487 | | |
486 | | - | |
487 | | - | |
488 | | - | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
489 | 492 | | |
490 | 493 | | |
491 | 494 | | |
| |||
559 | 562 | | |
560 | 563 | | |
561 | 564 | | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| 568 | + | |
568 | 569 | | |
569 | 570 | | |
570 | 571 | | |
| |||
577 | 578 | | |
578 | 579 | | |
579 | 580 | | |
| 581 | + | |
580 | 582 | | |
581 | 583 | | |
582 | 584 | | |
583 | 585 | | |
| 586 | + | |
584 | 587 | | |
585 | 588 | | |
586 | 589 | | |
| |||
618 | 621 | | |
619 | 622 | | |
620 | 623 | | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
621 | 627 | | |
622 | 628 | | |
623 | 629 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
865 | 866 | | |
866 | 867 | | |
867 | 868 | | |
| |||
1120 | 1121 | | |
1121 | 1122 | | |
1122 | 1123 | | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
1123 | 1169 | | |
1124 | 1170 | | |
1125 | 1171 | | |
| |||
0 commit comments