Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8502765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:34:36+00:00 2026-06-11T01:34:36+00:00

Depending on the setting of autocreateDatastoreTxns, I get a memory leak, with one instance

  • 0

Depending on the setting of autocreateDatastoreTxns, I get a memory leak, with
one instance of each of the classes below created for each query (a read).
i.e. 100 queries creates 100 instances of each of the classes below (with the
exception of the DatastoreServiceConfig, which gets 2 instances per query).

I’ve found this using the Java VisualVM profiler in the development environment. The reason I’m doing this
is that in production, our instance heap sizes keep growing (usually getting too large
after 10-20 thousand requests) finally causing slow responses and instance restarts.
I don’t know if this is the cause, but it’s the first leak I’ve been able to identify so far.

// Leaks with datanucleus.appengine.autoCreateDatastoreTxns=false

org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManager
org.datanucleus.store.appengine.KeyRegistry
org.datanucleus.store.appengine.EmualtedXARResource
org.datanucleus.store.appengine.DatastoreConnectionFactoryImpl$DatastoreManagedConnection

// Leaks with datanucleus.appengine.autoCreateDatastoreTxns=true

com.google.appengine.api.datastore.DatastoreServiceConfig  // 2 instances per query
org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManager
com.google.appengine.api.datastore.AsyncDatastoreServiceImpl
com.google.appengine.api.datastore.DatastoreServiceImpl
org.datanucleus.store.appengine.jdo. DatastoreJDOTransation
com.google.appengine.api.datastore.DatastoreXARResource
com.google.appengine.api.datastore.DatastoreProperty
com.google.appengine.api.datastore.KeyRegistry
com.google.appengine.api.datastore.DatastoreConnectionFactoryImpl$DatastoreManagedConnection
com.google.appengine.api.datastore.TransactionStackImpl$ThreadLocalTransactionStack$StaticMember
com.google.appengine.api.datastore.TransactionStackImpl
org.datanucleus.store.appengine.RuntimeExceptionWrapperingDatastoreService

Here is my code:

PersistenceManager pm = PMF.get().getPersistenceManager();
try {
    account = pm.detachCopy(pm.getObjectById(Account.class, accountKey));
} catch (javax.jdo.JDOObjectNotFoundException ex) {
    account = null;
} finally {
    pm.close();
}

Any ideas/thoughts? Is this a real memory leak in Google AppEngine, or is it just fact of life for the development environment, or maybe my own error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:34:37+00:00Added an answer on June 11, 2026 at 1:34 am

    The development appserver is intended to simulate the semantics of the real appserver, so that you can develop with reasonable fidelity. That doesn’t include memory behavior, particularly with regard to the datastore. The dev server tends to keep things in memory in ways that the real appserver doesn’t. Profiling the development server can still be useful for sorting out leaks on the app side, but isn’t going to give you much guidance about leaks that may be on the appserver side. We do watch out for those, though. And heaps do fragment over time.

    Some apps, by the nature of their usage and data access patterns, benefit from larger front-end instances. Those cost more, so you have to test and weight the benefit against the added cost.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Depending on the method I used to get the execution policy setting for PowerShell,
Depending on how I map my linq queries to my domain objects, I get
I've received Mixed responses on this depending what walk-through I read, I've defined a
I have a script that is setting conversion rates depending on input boxes (works
I have a class with two buttons. Depending on which one is clicked a
I'm working on a Qt/C++ project, and one of its functions is setting up
Depending on command-line arguments, I'm setting a file pointer to point either towards a
I am setting up maven to take annotated java classes and produce some DDL
I am setting different text to a textblock depending on what control has been
Is there a setting (didn't find one of hand) or good add-in (SO is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.