This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/PROCESSOR-SDK-AM57X: HTTP server memory leaks when page updates in SDK 05.01.00.11

Part Number: PROCESSOR-SDK-AM57X
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hello,

I'm using AM572x IDK board with TI-RTOS SDK 05.01.00.11.

I created one HTTP server instance and added no pages to it. I'm using PRU2 ETH0 (J6 component in AM572x board) interface to ping & HTTP working, A15 0 core for code compilation and check.

I found that with ROV help (HeapMem with tab Detailed). You can find my dumped values below:

What action to reproduce totalFreeSize value
Pause after RTOS startup (in 5 seconds) 0xa82870
One (1) page receiving (by the web browser) 0xa82390
Pause processor execution (after 10 seconds) 0xa82390 (not changed)
One (1) page receiving (by the web browser) 0xa82360
One (1) page receiving (by the web browser) 0xa82330
Ten (10) pages receiving (by the web browser) 0xa82150
Pause processor execution (after 15 seconds) 0xa82150 (not changed)
Ten (10) pages receiving (by the web browser) 0xa81f70
Thirty (30) pages receiving (by the web browser) 0xa819d0

All of that time I pinged processor IP address, and it works good (when the processor was not paused). There are no other processor background tasks.

My memory size configuration from app.cfg file:

var Task = xdc.useModule('ti.sysbios.knl.Task');
Task.deleteTerminatedTasks = true;

/*
 *  ======== SYS/BIOS Configuration ========
 */

/* no rts heap */
Program.heap = 0x6000;
Program.argSize = 500;  /* minimum size */
Program.stack = 0x3000;

/* create a default heap */
var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');
var heapMemParams = new HeapMem.Params();
heapMemParams.size = 0xA90000;

var Memory = xdc.useModule('xdc.runtime.Memory');
Memory.defaultHeapInstance = HeapMem.create(heapMemParams);

var Defaults = xdc.useModule('xdc.runtime.Defaults');
Defaults.common$.namedInstance = true;

How can I fix that?

With regards,
Alex

P.S. I'm using Ubuntu x64 16.04.5 LTS with Firefox 65.0.1 web browser.

  • Hi,

    Please refer to this: e2e.ti.com/.../2522279

    Regards, Eric
  • Hello, Eric

    As you can see in the thread, that you linked, "The fix will be included in later SYS/BIOS releases (6.55/6.70)."

    I'm using BIOS version 6.73 and reproduce that bug. Fix from your linked thread was already applied in my SYS/BIOS version (file bios_6_73_00_12/packages/ti/sysbios/rts/gnu/ReentSupport.c, function ReentSupport_taskDeleteHook) and I checked, it enters in three _fclose_r functions for dchild threads.

    With regards,
    Alex

  • Alex,

    If this SYSBIOS fix already there, are you able to test with the Processor SDK RTOS 5.2 release to reproduce the issue?

    Regards, Eric
  • Eric,

    I checked new SDK (05.02 version) components in my project, rebuilt it, hardware restart the board and represents the bug again (with onboard JTAG).

    I used:

    • EDMA 2.12.5
    • IPC 3.50.3.04
    • NDK 3.40.1.01
    • SYS/BIOS 6.73.1.01
    • UIA 2.30.1.02
    • AM57xx PDK 1.0.13

    With regards,
    Alex

  • Hi,

    Thanks for confirming this! Are you able to provide the CCS project based on above toolset version and I can import and rebuilt? What is the IP address of this host server? On the host side, you open a browser to this server and manually refresh the webpage, is this what you do?

    Then you looked at the ROV to check the memory leak? How do you determine the leak is related to the TI NDK or NIMU driver code, not your server application?

    Regards, Eric
  • Hello Eric,

    lding said:
    Are you able to provide the CCS project based on above toolset version and I can import and rebuilt?

    I attached the CCS project to reproduce a bug. I minimized it as I can.

    a15_0_memory_leak.zip

    lding said:
    What is the IP address of this host server?

    IDK board server network configuration:

    • IP address: 192.168.4.4
    • Network mask: 255.255.255.0
    • Default gateway: 192.168.4.1

    I configured ONLY PRU2 ETH0 ethernet connector (component J6 on AM572x IDK board).

    lding said:
    On the host side, you open a browser to this server and manually refresh the webpage, is this what you do?

    On my PC I just manually refresh webpage and check new value of total free memory on HeapMem. I do that several times without board restarting, and every time bug repeats.

    lding said:
    Then you looked at the ROV to check the memory leak?

    Yes, I paused processor with JTAG and check total free memory of HeapMem (I wrote that in starting post).

    lding said:
    How do you determine the leak is related to the TI NDK or NIMU driver code, not your server application?

    There is no code in the attached project, that works in TI-RTOS after it fully starts & PRU firmware loads. Only 5 tasks work in RTOS: Idle, NDK, PRU2 Rx task, PRU2 Tx task, daemon.

    Daemon task was configured by NDK HTTP server, not me.

    With regards,
    Alex

  • Alex,

    Thanks for all the info! I was able to build and run your application. One thing is ROV view, I used CCS---->Tools---->ROV Classic, I got error "
    An error has occurred. See error log for more details.
    com.ti.dvt.symbolmanager.ISymbolPackage.getSectionAddress(I)J"

    So I can't see anything in ROV

    Do you have similar issue? What is the CCS version you used? I am using CCS 8.2.

    Regards, Eric
  • Hi,

    Never mind! CCS 8.1 worked for ROV purpose. Below is the toolset I used (same as yours):

    "C:/ti/ccs_8_1_0/xdctools_3_50_07_20_core/xs" --xdcpath="C:/ti/bios_6_73_01_01/packages;C:/ti/pdk_am57xx_1_0_13/packages;C:/ti/ndk_3_40_01_01/packages;C:/ti/edma3_lld_2_12_05_30C/packages;C:/ti/ipc_3_50_03_04/packages;C:/ti/uia_2_30_01_02/packages;"

    I have the continued ping to the EVM, the HeapMem---->TotalFreeSize is steady.

    Then, I opened a Chrome web browser to this IP address (as no files hosted on the EVM, I got HTTP/1.0 404 - File Not Found) and re-fresh several times. Then checked the HeapMem---->TotalFreeSize. I confirmed the HeapMem---->TotalFreeSize decreased after I made web access. Yes, this is a memory leak.

    I opened a ticket for this.

    Regards, Eric
  • Alex,

    The issue was assigned to engineer team for debug and it will be fixed in a future release. I will be out of office and come back middle of next week. I will update you if we have a schedule at that time.

    Regards, Eric
  • Hi,

    The issue is planned to be fixed in Processor SDK RTOS 6.0 release, which will be GA at the end of Q2 2019. I am closing this thread.

    Regards, Eric