Skip to content

Commit

Permalink
fix memory leak by ofport_usage and trim memory periodically
Browse files Browse the repository at this point in the history
  • Loading branch information
oilbeater committed Aug 9, 2022
1 parent 2d2c83c commit 2dc8e7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ofproto/ofproto.c
Expand Up @@ -2385,7 +2385,7 @@ static void
dealloc_ofp_port(struct ofproto *ofproto, ofp_port_t ofp_port)
{
if (ofp_to_u16(ofp_port) < ofproto->max_ports) {
ofport_set_usage(ofproto, ofp_port, time_msec());
ofport_remove_usage(ofproto, ofp_port);
}
}

Expand Down
2 changes: 2 additions & 0 deletions vswitchd/bridge.c
Expand Up @@ -18,6 +18,7 @@
#include <errno.h>
#include <inttypes.h>
#include <stdlib.h>
#include <malloc.h>

#include "async-append.h"
#include "bfd.h"
Expand Down Expand Up @@ -3255,6 +3256,7 @@ bridge_run__(void)
void
bridge_run(void)
{
malloc_trim(0);
static struct ovsrec_open_vswitch null_cfg;
const struct ovsrec_open_vswitch *cfg;

Expand Down

0 comments on commit 2dc8e7a

Please sign in to comment.