Commit b38df6c
authored
core: Reduce per-stream idle memory by 20%
Metadata was accidentally being retained after the start of the call.
That can be an overwhelming percentage of memory for an idle RPC; don't
do that. The other changes are considerably smaller, but I happened to
notice them and the changes are straight-forward without magic numbers
(e.g., there's many arrays that could be tuned).
The regular interop server uses 4600 bytes per full duplex stream while
idle, but much of that is Census recorded events hanging around. Keeping
the Census integration but removing the Census impl (so a noop is used)
drops that to 3000 bytes. This change brings that down to ~2450 bytes
(which is still including stuff from TestServiceImpl). But there's very
little Metadata in the interop tests, so absolute real-life savings
would be much higher (but relative real-life savings may be lower,
because the application will often have more state).
The measurements were captured using a modified
timeout_on_sleeping_server client that had 100,000 concurrent full
duplex calls on one connection.1 parent 13b4b97 commit b38df6c
3 files changed
Lines changed: 59 additions & 42 deletions
File tree
- core/src/main/java/io/grpc/internal
- interop-testing/src/main/java/io/grpc/testing/integration
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
317 | 323 | | |
318 | 324 | | |
319 | 325 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
| |||
622 | 624 | | |
623 | 625 | | |
624 | 626 | | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
| 627 | + | |
638 | 628 | | |
639 | 629 | | |
640 | 630 | | |
| |||
648 | 638 | | |
649 | 639 | | |
650 | 640 | | |
651 | | - | |
652 | | - | |
| 641 | + | |
653 | 642 | | |
654 | 643 | | |
655 | 644 | | |
| |||
707 | 696 | | |
708 | 697 | | |
709 | 698 | | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
710 | 724 | | |
711 | 725 | | |
712 | 726 | | |
| |||
Lines changed: 23 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
53 | | - | |
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
| |||
511 | 509 | | |
512 | 510 | | |
513 | 511 | | |
514 | | - | |
| 512 | + | |
515 | 513 | | |
516 | 514 | | |
517 | | - | |
518 | | - | |
| 515 | + | |
519 | 516 | | |
520 | 517 | | |
521 | 518 | | |
522 | 519 | | |
523 | | - | |
| 520 | + | |
524 | 521 | | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
525 | 526 | | |
526 | 527 | | |
527 | 528 | | |
528 | | - | |
| 529 | + | |
529 | 530 | | |
530 | 531 | | |
531 | 532 | | |
532 | 533 | | |
533 | 534 | | |
534 | | - | |
| 535 | + | |
535 | 536 | | |
536 | 537 | | |
537 | 538 | | |
| |||
540 | 541 | | |
541 | 542 | | |
542 | 543 | | |
543 | | - | |
| 544 | + | |
544 | 545 | | |
545 | | - | |
546 | | - | |
| 546 | + | |
547 | 547 | | |
548 | 548 | | |
549 | 549 | | |
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
553 | 557 | | |
554 | 558 | | |
555 | 559 | | |
556 | | - | |
| 560 | + | |
557 | 561 | | |
558 | 562 | | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | 563 | | |
565 | 564 | | |
566 | 565 | | |
567 | 566 | | |
568 | 567 | | |
569 | 568 | | |
570 | | - | |
| 569 | + | |
571 | 570 | | |
572 | | - | |
573 | | - | |
| 571 | + | |
574 | 572 | | |
575 | 573 | | |
576 | 574 | | |
577 | 575 | | |
578 | 576 | | |
579 | 577 | | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
580 | 582 | | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | 583 | | |
587 | 584 | | |
588 | | - | |
| 585 | + | |
589 | 586 | | |
590 | 587 | | |
591 | 588 | | |
| |||
0 commit comments