diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 19366eb2c1c1..291c2eb7e0ca 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -962,8 +962,12 @@ static void do_show_route_helper(struct vty *vty, struct zebra_vrf *zvrf, } } + /* + * This is an extremely expensive operation at scale + * and non-pretty reduces memory footprint significantly. + */ if (use_json) - vty_json(vty, json); + vty_json_no_pretty(vty, json); } static void do_show_ip_route_all(struct vty *vty, struct zebra_vrf *zvrf, diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index 5178448ebcbe..50a7462d89cc 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -3229,7 +3229,11 @@ void zebra_vxlan_print_macs_vni(struct vty *vty, struct zebra_vrf *zvrf, if (use_json) { json_object_object_add(json, "macs", json_mac); - vty_json(vty, json); + /* + * This is an extremely expensive operation at scale + * and non-pretty reduces memory footprint significantly. + */ + vty_json_no_pretty(vty, json); } } @@ -4014,8 +4018,12 @@ void zebra_vxlan_print_vnis_detail(struct vty *vty, struct zebra_vrf *zvrf, void *))zl3vni_print_hash_detail, &zes); + /* + * This is an extremely expensive operation at scale + * and non-pretty reduces memory footprint significantly. + */ if (use_json) - vty_json(vty, json_array); + vty_json_no_pretty(vty, json_array); } /*