I am writing a genetic algorithm which generates several neural networks and calculates their fitness. After that the neural network is not needed anymore and can be removed. However, they seem to stay alive in the off-heap memory and thus leading to a memory leak after a while. How can I destroy / remove the neural network completely after receiving the fitness value (evaluation)?
What you’re looking for are “workspaces”: https://deeplearning4j.konduit.ai/config/config-memory/config-workspaces