You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@yunikorn.apache.org by "Craig Condit (Jira)" <ji...@apache.org> on 2024/01/09 15:28:00 UTC

[jira] [Comment Edited] (YUNIKORN-2319) Memory leak in cache.Task: reference to old pod object is kept after update

    [ https://issues.apache.org/jira/browse/YUNIKORN-2319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17804775#comment-17804775 ] 

Craig Condit edited comment on YUNIKORN-2319 at 1/9/24 3:27 PM:
----------------------------------------------------------------

I would be very wary of changing this at all. The original Pod is stored as part of the task when it is originally created, meaning we can rely on the fields referenced within it not changing. Making that a "live" reference to the latest Pod may have unforseen consequences. We would also need to ensure that access to the Pod is locked when accessed by the task, which is not really possible the way the code is currently written.

This is not a memory leak in the traditional sense; the original pod reference will be GC'd when the task goes out of scope. We also don't accumulate all versions of the pod, only the original and newest, so the scope and impact is limited.


was (Author: ccondit):
I would be very wary of changing this at all. The original Pod is stored as part of the task when it is originally created, meaning we can rely on the fields referenced within it not changing. Making that a "live" reference to the latest Pod may have unforseen consequences.

This is not a memory leak in the traditional sense; the original pod reference will be GC'd when the task goes out of scope. We also don't accumulate all versions of the pod, only the original and newest, so the scope and impact is limited.

> Memory leak in cache.Task: reference to old pod object is kept after update
> ---------------------------------------------------------------------------
>
>                 Key: YUNIKORN-2319
>                 URL: https://issues.apache.org/jira/browse/YUNIKORN-2319
>             Project: Apache YuniKorn
>          Issue Type: Bug
>          Components: shim - kubernetes
>            Reporter: Peter Bacsko
>            Assignee: Peter Bacsko
>            Priority: Major
>         Attachments: 2024-01-09 134112.png, 2024-01-09 134130.png
>
>
> There is a memory leak in the shim: when the pod is updated, the old pod object is still referenced from Task, so the GC has no chance to remove it.
> See screenshot: task points to version 80199, scheduler cache already has a newer version 81216.
> We have two solutions:
> 1. Update the object in the Task together with the scheduler cache
> 2. Don't store the pointer to the pod, instead, always retrieve it from the scheduler cache



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@yunikorn.apache.org
For additional commands, e-mail: issues-help@yunikorn.apache.org