Skip to content

Task Cleanup leaks 160B of Memory #522

@smallbraineng

Description

@smallbraineng

Bug description

If a FreeRTOS task is created with ThreadSpawnConfig, it leaks 160 bytes in memory when cle

  • Would you like to work on a fix? [y/n]

To Reproduce

  1. Create any task with threadspawnconfig, then join and drop it
  2. Check the memory usage before and after
 loop {
        log::info!("\n");
        log::info!("============== BEFORE TEST TASK ===========");
        print_memory_info();
        let test_task = spawn("test\0", 1024 * 10, 1, Some(Core::Core0), move || {
            sleep(Duration::from_secs(3));
        });
        test_task.join().unwrap();
        log::info!("\n");
        log::info!("============== AFTER TEST TASK ===========");
        print_memory_info();
    }

and in print_memory_info,

 log::info!(
            " Free: {} bytes",
            heap_caps_get_free_size(MALLOC_CAP_INTERNAL)
        );

Expected behavior

It to clean up the task fully

Environment

  • esp-idf-svc 0.51
  • Target device (MCU): esp32s3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions