Skip to content

unnamed threads don't appear to be freed, at least not in a timely manner. #396

@jolivier23

Description

@jolivier23

I'm using v1.1. To illustrate, I made this patch to the hello_world example. If I run with a large number of ULTs, the memory grows very fast. Since it is executing hello_world, I would expect it to be a much smaller memory footprint. Note, I also changed the stacksize, not sure if that has anything to do with the problem but it matches an issue we see with memory growth in DAOS

index 822b10f..8b988be 100644
--- a/examples/hello_world/hello_world.c
+++ b/examples/hello_world/hello_world.c
@@ -81,19 +81,23 @@ int main(int argc, char **argv)
     for (i = 0; i < num_xstreams; i++) {
         ABT_xstream_get_main_pools(xstreams[i], 1, &pools[i]);
     }
+ABT_thread_attr attr;
+ABT_thread_attr_create(&attr);
+
+ABT_thread_attr_set_stacksize(attr, 128*1024);
 
     /* Create ULTs. */
     for (i = 0; i < num_threads; i++) {
+	int rc1;
         int pool_id = i % num_xstreams;
+
         thread_args[i].tid = i;
         ABT_thread_create(pools[pool_id], hello_world, &thread_args[i],
-                          ABT_THREAD_ATTR_NULL, &threads[i]);
+                          attr, NULL);
     }
 
     /* Join and free ULTs. */
-    for (i = 0; i < num_threads; i++) {
-        ABT_thread_free(&threads[i]);
-    }
+    ABT_thread_attr_free(&attr);
 
     /* Join and free secondary execution streams. */
     for (i = 1; i < num_xstreams; i++) {```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions