The out-of-memory issue may be occurring because there is a finite amount of memory process that can be used. Hence, if you have a very large topology or lot of notifications in the SAM repository, then it would result in hitting the limit. Memory usage increases to the maximum during topology synchronization because new topology objects are created during synchronization.