Menu

#11 ipmiutil: Memory leaks

ipmiutil-2.9.x
closed
8
2015-09-23
2014-12-05
Aleksey
No

(Windows, ipmiutil-2.9.5)

Hi,

I have the following task: I need to write the information about the CPU temperature, motherboard temperature and so on to the database. In my project I have included ipmicmd.h isensor.h isensor.c. I link it with ipmiutil.lib.
At the beginning, I get sdr cache and save it in the buffer for each sensor. Then every second I call the GetSensorReading() function from isensor.c. All works fine, but there is a significant memory leaks. After running an application just for 1-2 minutes, there is about 1MB leak. The application that just calls this function after a month of work takes 90 MB of RAM (7 MB at the start)! It do nothing except calling this function.

You can very easy check it even with your examples. Just run impiutil.exe sensor -g temp -j dump -s -w -L 50 or ipmi_sample2.exe -i 1 -l 50 and you will be able to watch how your memory is eaten up in real time.

Any suggestions to fix it?
Thank you for your help.

Best regards,
Aleksey

Related

Support Requests: #11

Discussion

  • Aleksey

    Aleksey - 2014-12-05

    It seems to me that the same problem has been already discussed in this topic. But the attached fix is not working for me because it's for Linux.

     
  • Andy Cress

    Andy Cress - 2014-12-06

    Hmmm. I'm guessing that it might be reallocating the sdr cache, but I don't see it right away. I'll have a closer look. When you run 'ipmiutil sensor ...' without -j does the leak go away?

     
  • Aleksey

    Aleksey - 2014-12-06

    No, it doesn't.
    -j option just decrease the cpu usage.
    Anyway even without this option the leak doesn't go away.

     
  • Andy Cress

    Andy Cress - 2015-01-13

    Aleksey,
    Sorry for the delay in responding, but I have had trouble reproducing this on my systems.
    The link you referenced in the original description related to the openipmi Linux driver, so perhaps it is not in ipmiutil but the driver in this case as well.
    In Windows, there are two drivers supported: Microsoft ipmidrv.sys and Intel imbdrv.sys.
    The Microsoft driver comes with Windows, but does not work on all platforms.
    The main test platforms I am using have the Intel imbdrv, and I do not see the leak either in Linux or in Windows (with imbdrv), so that leads me to look at the driver.
    I'm guessing that you are using the Microsoft ipmidrv (shown via 'driverquery')?

    If so, we can hopefully find something that can be fixed in how it is being called, because Microsoft has not fixed any bugs in that driver for a very long time.
    The output of a session showing the leak, adding the debug '-x' parameter may help.
    Andy

     
  • Aleksey

    Aleksey - 2015-01-16

    Thank you for your reply!
    Yes, I used the Microsoft driver. Now I have installed the Intel imbdrv and all leaks are gone. Thank you again!

     
    • Andy Cress

      Andy Cress - 2015-01-16

      FYI. I have been able to reproduce the leak using the Microsoft
      driver, and am investigating this further to see if I can work around
      the WBEM access method to eliminate the leak for MS ipmidrv.sys.

      On Fri, Jan 16, 2015 at 1:56 AM, Aleksey renzzo@users.sf.net wrote:

      Thank you for your reply!
      Yes, I used the Microsoft driver. Now I have installed the Intel imbdrv and
      all leaks are gone. Thank you again!


      [support-requests:#11] ipmiutil: Memory leaks

      Status: open
      Group: ipmiutil-2.9.x
      Labels: bug memory leak ipmi windows
      Created: Fri Dec 05, 2014 12:22 PM UTC by Aleksey
      Last Updated: Tue Jan 13, 2015 07:04 PM UTC
      Owner: nobody

      (Windows, ipmiutil-2.9.5)

      Hi,

      I have the following task: I need to write the information about the CPU
      temperature, motherboard temperature and so on to the database. In my
      project I have included ipmicmd.h isensor.h isensor.c. I link it with
      ipmiutil.lib.
      At the beginning, I get sdr cache and save it in the buffer for each sensor.
      Then every second I call the GetSensorReading() function from isensor.c. All
      works fine, but there is a significant memory leaks. After running an
      application just for 1-2 minutes, there is about 1MB leak. The application
      that just calls this function after a month of work takes 90 MB of RAM (7 MB
      at the start)! It do nothing except calling this function.

      You can very easy check it even with your examples. Just run impiutil.exe
      sensor -g temp -j dump -s -w -L 50 or ipmi_sample2.exe -i 1 -l 50 and you
      will be able to watch how your memory is eaten up in real time.

      Any suggestions to fix it?
      Thank you for your help.

      Best regards,
      Aleksey


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/ipmiutil/support-requests/11/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Support Requests: #11

  • Andy Cress

    Andy Cress - 2015-09-23
    • status: open --> closed
    • assigned_to: Andy Cress
     
  • Andy Cress

    Andy Cress - 2015-09-23

    Memory leak was in Microsoft ipmidrv.sys. Problem report to Microsoft received no response. Switching to Intel driver resolved the problem.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.