Skip to content

Commit

Permalink
[device/accton]: As7816-64x, fix memory leakage on accton fan monitor. (
Browse files Browse the repository at this point in the history
#6168)

It's been reported that accton fan monitor process keeps consuming memory after few days.
The amount of memory occupied increases in linear and never leased.

Signed-off-by: roy_lee <[email protected]>
  • Loading branch information
roylee123 authored and lguohan committed Jan 15, 2021
1 parent 4f6e161 commit 29562d0
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ class accton_as7816_monitor(object):

def __init__(self, log_file, log_level):
"""Needs a logger and a logger level."""

self.thermal = ThermalUtil()
self.fan = FanUtil()
# set up logging to file
logging.basicConfig(
filename=log_file,
Expand Down Expand Up @@ -83,8 +86,8 @@ def manage_fans(self):
4: [max_duty, 57000, sys.maxsize],
}

thermal = ThermalUtil()
fan = FanUtil()
thermal = self.thermal
fan = self.fan
for x in range(fan.get_idx_fan_start(), fan.get_num_fans()+1):
fan_status = fan.get_fan_status(x)
if fan_status is None:
Expand Down

0 comments on commit 29562d0

Please sign in to comment.