Is the Nx Cloud up? Visit our Status Page for the current health and performance of the Nx Cloud.

Status Page

How run metavms with valgrind?

Answered

Comments

7 comments

  • Andrey Terentyev
    • Network Optix team

    Hello James Yu ,

    Could you please describe your set-up in grater detail? How many cameras? What is hi,lo stream quality? What is server configuration: OS, RAM, VMS build?

     

    0
  • Permanently deleted user

    Hi Andrey,

    Setup is as follows:
    number of stream => 10
    stream quality => 1920x1080, 25fps, H264, Hi-Res
    OS => Ubuntu 18.04.6 LTS
    RAM => 32G
    VMS build => 4.2.0.32836 (both client & server)

    Following is the memory trend for last ~24hrs, "dummy plugin" indicates that DeviceAgent::pushUncompressedVideoFrame() returns immediately when invoked by NX server:

    0
  • Andrey Terentyev
    • Network Optix team

    Hello James,

    I would like to use valgrind to pin down possible memory leak in my plugin, how should I do it?

    1. Here is the pattern of the command to start the Server under valgrind

    sudo valgrind $ARGS $SERVER_BIN -e >$LOG_FILE.out 2>&1

    Pay your attention, you should pass the "-e" argument to the Server.

    2. As $ARGS your the following:

    for leak: "--leak-check=yes --show-leak-kinds=definite,possible --undef-value-errors=no $SUP"
    for massif: "--tool=massif --massif-out-file=$OUT.massif"

    0
  • Andrey Terentyev
    • Network Optix team

    James,

    Following is the memory trend for last ~24hrs, "dummy plugin" indicates that DeviceAgent::pushUncompressedVideoFrame() returns immediately when invoked by NX server:

    Could you share the source code of your plugin, please?

    The memory usage over last 6 hours shows a a trend going up without running any plugin, is this normal?

    It could be expected behavior. Memory utilization tends to stop at some value. It depends on the server configuration and is more about OS memory management.

    0
  • Permanently deleted user

    Hi Andrey,

    which email should I send the files to?

    0
  • Permanently deleted user

    Hi Andrey,

    I tried to start the Server under valgrind with the following command and failed (as root and networkoptix-metavms):

    valgrind --leak-check=yes --show-leak-kinds=definite,possible --undef-value-errors=no $SUP /opt/networkoptix-metavms/mediaserver/bin/mediaserver-bin -e >/tmp/valgrind.out 2>&1


    This is the error logged in /tmp/valgrind.out:

    ==32732== 
    ==32732== Warning: Can't execute setuid/setgid/setcap executable: /opt/networkoptix-metavms/mediaserver/bin/mediaserver-bin
    ==32732== Possible workaround: remove --trace-children=yes, if in effect
    ==32732==
    valgrind: /opt/networkoptix-metavms/mediaserver/bin/mediaserver-bin: Permission denied
    0
  • Andrey Terentyev
    • Network Optix team

    Hello James,

    There is a limitation intentionally set to avoid the server to be run under the valgrind.

    Here is a workaround

    sudo cp /opt/networkoptix-metavms/mediaserver/bin/mediaserver-bin /opt/networkoptix-metavms/mediaserver/bin/mediaserver-valgrind
    sudo chmod 755 /opt/networkoptix-metavms/mediaserver/bin/mediaserver-valgrind
    sudo valgrind --leak-check=yes --show-leak-kinds=definite,possible --undef-value-errors=no /opt/networkoptix-metavms/mediaserver/bin/mediaserver-valgrind -e >/tmp/valgrind.out 2>&1

     

    0

Please sign in to leave a comment.