Memory Leaks? Leaking keystore entries?

499 views
Skip to first unread message

Sheado

unread,
May 27, 2011, 6:06:10 PM5/27/11
to Google AdMob Ads Developers
Hi All,

We're using AdMob with AdWhirl, but in this case AdMob is the only
active network.
Our app has been running out of memory, and after profiling with
Eclipse MAT we discovered tons of ~2000 byte arrays piling up (they
contributed the most to the byte[] shallow heap). The path to GC root
without weak references to these arrays looks like this:

byte[2174] @ 0x40199298 0..W0..?............... Mun...| 2,192
| 2,192

'- buf java.io.ByteArrayOutputStream @
0x4008f948
| 16 | 2,208

'- encodedOut org.bouncycastle.jce.provider.X509CertificateObject @
0x400aae48
| 24 | 5,912

|- obj org.bouncycastle.jce.provider.JDKKeyStore$StoreEntry @
0x400863b8
| 32 | 48

| '- value java.util.Hashtable$HashtableEntry @
0x4007d2e8
| 24 | 112

| '- [49] java.util.Hashtable$HashtableEntry[128] @
0x40147ba8
| 528 | 6,800

| '- table java.util.Hashtable @
0x400e5900
| 40 | 6,840

| '- table org.bouncycastle.jce.provider.JDKKeyStore @
0x400e5d50
| 16 | 7,520

| |- spi
org.apache.harmony.security.fortress.Engine @
0x400c9338
| 32 | 32

| | '- engine class java.security.KeyStore @
0x400da450 System
Class
| 24 | 56

| |- implSpi java.security.KeyStore @
0x400e4c80
| 24 | 24

| '- Total: 2
entries
| |

|- trustedCert java.security.cert.TrustAnchor @
0x4010c4d8
| 32 | 32

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



Or sometimes like this:
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

byte[2174] @ 0x40177138
0..^.............www.usertrust.com.....................U...|
2,192 | 2,192

'- buf java.io.ByteArrayOutputStream @
0x40142118
| 16 | 2,208

'- encodedOut org.bouncycastle.jce.provider.X509CertificateObject @
0x4012b4c8
| 24 | 6,232

|- trustedCert java.security.cert.TrustAnchor @
0x400dfcc8
| 32 | 32

| '- value java.util.HashMap$HashMapEntry @
0x400d35d0
| 24 | 2,256

| '- [105] java.util.HashMap$HashMapEntry[128] @
0x401a6d20
| 528 | 102,248

| '- table java.util.HashMap @
0x4014d3b0
| 48 | 102,296

| '- bySubject
org.bouncycastle.jce.provider.IndexedPKIXParameters @
0x401693e0
| 56 | 169,904

| '- params
org.apache.harmony.xnet.provider.jsse.TrustManagerImpl @
0x40168af8
| 24 | 169,976

| |- defaultTrustManager class
org.apache.harmony.xnet.provider.jsse.SSLParameters @ 0x4007ef00
System
Class
| 16 | 16

| |- trustManager
org.apache.harmony.xnet.provider.jsse.SSLParameters @
0x4007efa8
| 48 | 48

| |- trustManager
org.apache.harmony.xnet.provider.jsse.SSLParameters @
0x401c8238
| 48 | 48

| '- Total: 3
entries
| |

|- obj org.bouncycastle.jce.provider.JDKKeyStore$StoreEntry @
0x4012b940
| 32 | 48

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Is this a bug? If so, is there a workaround? A response from AdMob
peoples would be awesome!
Thank You!

wes

unread,
May 27, 2011, 6:14:54 PM5/27/11
to google-adm...@googlegroups.com
Pretty sure this at least has nothing to do with AdWhirl.  Do you see these arrays piling up without the Google AdMob Ads SDK?  Is your app doing any other sort of work with SSL?

Cheers,
Wes

Sheado

unread,
May 27, 2011, 6:24:31 PM5/27/11
to Google AdMob Ads Developers
Hi Wes,

We do not use SSL in our app. In fact, the only thing that touches the
network are the ads.
I can go ahead and test with all the ad code removed, but I'm pretty
sure this has something to do with the ads. We do refresh the ads
every other time a user accesses the inventory in our game (this can
happen quite frequently in certain parts of the game).

I can forward you the hprof file if that would be helpful.

Thanks for the quick response!

wes

unread,
May 31, 2011, 8:44:06 PM5/31/11
to google-adm...@googlegroups.com
It might help.  Could you also let me know the version of Android you're using, the make/model of the phone, and the version of our SDK you've implemented?

Cheers,
Wes
Reply all
Reply to author
Forward
0 new messages