Grails memory leakage for bulk upload - HibernatePersistenceContextInterceptor
问题 I am using Quartz job to do some backend processing, which result into bulk upload to database. I am explicitly clearing up the session as given below. class MyService { def sessionFactory static transactional = false def runJob() { def collectionOfDomain = [] for { collectionOfDomain.add(someData) if(collectionOfDomain.size() == 200) { SomeDomain.saveAll(collectionOfDomain) sessionFactory.currentSession.flush() sessionFactory.currentSession.clear() collectionOfDomain.clear() } } } } My