To determine if this is a memory leak, you will need to monitor it more.
From your description, that is, as soon as the maximum memory is reached, the GC will start working and be able to free up memory to run your application, this is not like a leak.
Also, you should not call GC yourself, as
- this is only an indicator
- can potentially affect the underlying algorithm, affecting its performance.
Instead, you should focus on why your application needs so much memory in such a short period.