Already filed an issue about this
at:
https://code.google.com/p/googleappengine/issues/detail?id=12945&thanks=12945&ts=1462375553
On Wednesday, May 4, 2016 at 6:28:15 PM UTC+3, Miroslav Genov wrote:
>
> Hello,
>
>
> GAE Java SDK: 1.9.36
>
> The following test shows that LocalServiceTestHelper is creating a new thread
> on each setUp which is not closed on tearDown which leads to memory leak.
>
> @Test
> public void happyPath() {
> final LocalServiceTestHelper helper = new LocalServiceTestHelper(
> new LocalSearchServiceTestConfig(),
> new LocalDatastoreServiceTestConfig().setApplyAllHighRepJobPolicy()
>
> );
>
> for (int i = 0; i < 3000000;i++) {
> helper.setUp();
>
> helper.tearDown();
> }
> }
>
> The following snippet is crashing with:
>
> java.lang.OutOfMemoryError: unable to create new native thread
> at java.lang.Thread.start0(Native Method)
> at java.lang.Thread.start(Thread.java:714)
> at
> java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:949)
> at
> java.util.concurrent.ThreadPoolExecutor.ensurePrestart(ThreadPoolExecutor.java:1590)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor.delayedExecute(ScheduledThreadPoolExecutor.java:333)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor.scheduleWithFixedDelay(ScheduledThreadPoolExecutor.java:594)
> at
> com.google.appengine.api.datastore.dev.LocalDatastoreService.startInternal(LocalDatastoreService.java:593)
> at
> com.google.appengine.api.datastore.dev.LocalDatastoreService.access$300(LocalDatastoreService.java:146)
> at
> com.google.appengine.api.datastore.dev.LocalDatastoreService$2.run(LocalDatastoreService.java:582)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> com.google.appengine.api.datastore.dev.LocalDatastoreService.start(LocalDatastoreService.java:579)
> at
> com.google.appengine.tools.development.ApiProxyLocalImpl.startServices(ApiProxyLocalImpl.java:624)
> at
> com.google.appengine.tools.development.ApiProxyLocalImpl.access$700(ApiProxyLocalImpl.java:47)
> at
> com.google.appengine.tools.development.ApiProxyLocalImpl$2.run(ApiProxyLocalImpl.java:604)
> at
> com.google.appengine.tools.development.ApiProxyLocalImpl$2.run(ApiProxyLocalImpl.java:601)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> com.google.appengine.tools.development.ApiProxyLocalImpl.getService(ApiProxyLocalImpl.java:600)
> at
> com.google.appengine.tools.development.testing.LocalServiceTestHelper.getLocalService(LocalServiceTestHelper.java:589)
> at
> com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig.getLocalDatastoreService(LocalDatastoreServiceTestConfig.java:295)
> at
> com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig.tearDown(LocalDatastoreServiceTestConfig.java:289)
> at
> com.google.appengine.tools.development.testing.LocalServiceTestHelper.tearDownService(LocalServiceTestHelper.java:548)
> at
> com.google.appengine.tools.development.testing.LocalServiceTestHelper.tearDown(LocalServiceTestHelper.java:520)
>
>
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-appengine/7f44258a-94cc-42d0-974a-d2c00d789d19%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.