diff --git a/core/java/src/net/i2p/I2PAppContext.java b/core/java/src/net/i2p/I2PAppContext.java
index ac4996d638c0e90abdf8df798eb009fd1732b450..0ae7279bed2887d5b0446caad52889d0191174aa 100644
--- a/core/java/src/net/i2p/I2PAppContext.java
+++ b/core/java/src/net/i2p/I2PAppContext.java
@@ -5,6 +5,7 @@ import java.util.Properties;
 import java.util.Set;
 
 import net.i2p.client.naming.NamingService;
+import net.i2p.client.naming.PetNameDB;
 import net.i2p.crypto.AESEngine;
 import net.i2p.crypto.CryptixAESEngine;
 import net.i2p.crypto.DSAEngine;
@@ -60,6 +61,7 @@ public class I2PAppContext {
     private StatManager _statManager;
     private SessionKeyManager _sessionKeyManager;
     private NamingService _namingService;
+    private PetNameDB _petnameDb;
     private ElGamalEngine _elGamalEngine;
     private ElGamalAESEngine _elGamalAESEngine;
     private AESEngine _AESEngine;
@@ -74,6 +76,7 @@ public class I2PAppContext {
     private volatile boolean _statManagerInitialized;
     private volatile boolean _sessionKeyManagerInitialized;
     private volatile boolean _namingServiceInitialized;
+    private volatile boolean _petnameDbInitialized;
     private volatile boolean _elGamalEngineInitialized;
     private volatile boolean _elGamalAESEngineInitialized;
     private volatile boolean _AESEngineInitialized;
@@ -128,6 +131,7 @@ public class I2PAppContext {
         _statManager = null;
         _sessionKeyManager = null;
         _namingService = null;
+        _petnameDb = null;
         _elGamalEngine = null;
         _elGamalAESEngine = null;
         _logManager = null;
@@ -237,6 +241,19 @@ public class I2PAppContext {
         }
     }
     
+    public PetNameDB petnameDb() {
+        if (!_petnameDbInitialized) initializePetnameDb();
+        return _petnameDb;
+    }
+    private void initializePetnameDb() {
+        synchronized (this) {
+            if (_petnameDb == null) {
+                _petnameDb = new PetNameDB();
+            }
+            _petnameDbInitialized = true;
+        }
+    }
+    
     /**
      * This is the ElGamal engine used within this context.  While it doesn't
      * really have anything substantial that is context specific (the algorithm
diff --git a/core/java/src/net/i2p/client/naming/PetNameNamingService.java b/core/java/src/net/i2p/client/naming/PetNameNamingService.java
index 164498d4a7af698d335bf90a0d8751d23e97faf3..9a2446aba3795dec28c2db33125b2e5ae1520fc1 100644
--- a/core/java/src/net/i2p/client/naming/PetNameNamingService.java
+++ b/core/java/src/net/i2p/client/naming/PetNameNamingService.java
@@ -17,7 +17,7 @@ public class PetNameNamingService extends NamingService {
     
     public PetNameNamingService(I2PAppContext context) {
         super(context);
-        _petnameDb = new PetNameDB();
+        _petnameDb = _context.petnameDb();
         String file = _context.getProperty(PROP_PETNAME_FILE, DEFAULT_PETNAME_FILE);
 
         //If the petnamedb file doesn't exist, create it, using the