I think it depends on your configurations.
- Are you using on-heap/off-heap managed memory? (configured by
'taskmanager.memory.off-heap', by default is false)

- Is managed memory pre-allocated? (configured by
'taskmanager.memory.preallocate', by default is ffalse)


If managed memory is pre-allocated, then the allocated memory segments will
never be released. If it's not pre-allocated, memory segments should be
released when the task is finished, but the actual memory will not be
de-allocated until next GC. Since the job is finished, there may not be
enough heap activities to trigger the GC. If on-heap memory is used, you
may not be able to observe the decreasing of TM memory usage, because JVM
heap size does not scale down. Only if off-heap memory is used, you might
be able to observe the decreasing of TM memory usage after a GC, but not
from a jmap dump because jmap dumps heap memory usage only.


Besides, I don't think you need to worry about whether memory is released
after one job is finished. Sometimes flink/jvm do not release memory after
jobs/tasks finished, so that it can be reused directly by other jobs/tasks,
for the purpose of reducing allocate/deallocated overheads and optimizing
performance.


Thank you~

Xintong Song



On Thu, Oct 10, 2019 at 7:55 PM Timothy Victor <vict...@gmail.com> wrote:

> After a batch job finishes in a flink standalone cluster, I notice that
> the memory isn't freed up.   I understand Flink uses it's own memory
> manager and just allocates a large tenured byte array that is not GC'ed.
>  But does the memory used in this byte array get released when the batch
> job is done?
>
> The scenario I am facing is that I am running a series of scheduled batch
> jobs on a standalone cluster with 1 TM and 1 Slot.  I notice that after a
> job is complete the memory used in the TM isn't freed up.  I can confirm
> this by running  jmap dump.
>
> Has anyone else run into this issue?   This is on 1.9.
>
> Thanks
>
> Tim
>

Reply via email to