Page 1 of 2

[SOLVED] Ubuntu - Java OutOfMemoryError

PostPosted: Fri Oct 31, 2014 6:45 pm
by orangeshasta
Hi All,

I'm having some problems with a new Subsonic installation on Ubuntu 14.04. I've been using Subsonic on Windows for years without too many issues, but recently migrated my library to a dedicated server. Here's what's happening:

Subsonic starts up without issue when the server boots up (or when I manually start the service). However, after some period of time, it stops responding when I try to access it. When the problem first occurred, it would happen after maybe 24 hours or so. I checked the log file and saw that I would always get an error that said:

Code: Select all
ERROR MediaScannerService - Failed to scan media library.
java.lang.OutOfMemoryError: Java heap space

After searching the forum, I saw some people had mentioned that the default max-memory argument is too low, and to increase it. So I increased it to 300, and found that while the problem kept occurring, it took longer for it to happen. I increased max-memory to 512, same thing. Finally I increased max-memory to 1024 - now it works for a few days without issue, but will eventually still stop responding.

My music library is 6,076 songs and 126.99 GB (mostly FLAC). Here's a partial of my log file:

Code: Select all
[2014-10-29 02:57:00,689] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 03:00:01,100] INFO MediaScannerService - Starting to scan media library.
[2014-10-29 03:00:52,831] INFO MediaScannerService - Scanned media library with 250 entries.
[2014-10-29 03:01:54,277] INFO MediaScannerService - Scanned media library with 500 entries.
[2014-10-29 03:02:26,565] INFO MediaScannerService - Scanned media library with 750 entries.
[2014-10-29 03:02:50,289] INFO MediaScannerService - Scanned media library with 1000 entries.
[2014-10-29 03:03:16,982] INFO MediaScannerService - Scanned media library with 1250 entries.
[2014-10-29 03:03:49,704] INFO MediaScannerService - Scanned media library with 1500 entries.
[2014-10-29 03:04:24,208] INFO MediaScannerService - Scanned media library with 1750 entries.
[2014-10-29 03:05:05,109] INFO MediaScannerService - Scanned media library with 2000 entries.
[2014-10-29 03:06:01,060] INFO MediaScannerService - Scanned media library with 2250 entries.
[2014-10-29 03:07:21,375] INFO MediaScannerService - Scanned media library with 2500 entries.
[2014-10-29 03:09:18,130] INFO MediaScannerService - Scanned media library with 2750 entries.
[2014-10-29 03:11:23,423] ERROR MediaScannerService - Failed to scan media library.
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 03:11:25,098] ERROR SearchService - Failed to create search index.
java.lang.IllegalStateException: this writer hit an OutOfMemoryError; cannot flush
        at org.apache.lucene.index.IndexWriter.doFlushInternal(IndexWriter.java:3612)
        at org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:3595)
        at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3585)
        at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:2338)
        at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:2316)
        at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:2286)
        at net.sourceforge.subsonic.service.SearchService.stopIndexing(SearchService.java:158)
        at net.sourceforge.subsonic.service.MediaScannerService.doScanLibrary(MediaScannerService.java:207)
        at net.sourceforge.subsonic.service.MediaScannerService.access$000(MediaScannerService.java:48)
        at net.sourceforge.subsonic.service.MediaScannerService$2.run(MediaScannerService.java:147)

[2014-10-29 03:11:25,666] INFO PlaylistService - Starting playlist import.
[2014-10-29 03:11:25,666] INFO PlaylistService - Completed playlist import.
[2014-10-29 03:11:25,666] INFO PlaylistService - Starting playlist statistics update.
[2014-10-29 03:11:25,666] INFO PlaylistService - Completed playlist statistics update.
[2014-10-29 04:57:13,085] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 04:57:23,622] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 06:53:26,865] WARN SettingsService - Failed to validate license.
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 06:57:36,510] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 06:57:47,629] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 06:58:06,942] INFO PodcastService - Starting scheduled Podcast refresh.
[2014-10-29 06:58:07,263] INFO PodcastService - Completed scheduled Podcast refresh.
[2014-10-29 08:58:04,356] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 08:58:12,133] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 10:58:31,123] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 10:58:39,872] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 12:58:58,007] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 12:59:08,318] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 14:59:25,749] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 14:59:37,906] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 17:00:07,238] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 17:00:23,318] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 19:00:47,603] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 19:01:00,494] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 21:01:18,169] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 21:01:42,482] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 23:01:56,714] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-29 23:02:22,995] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 01:02:42,724] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 01:03:06,776] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 03:00:00,845] INFO MediaScannerService - Starting to scan media library.
[2014-10-30 03:00:18,668] INFO MediaScannerService - Scanned media library with 250 entries.
[2014-10-30 03:00:38,159] INFO MediaScannerService - Scanned media library with 500 entries.
[2014-10-30 03:00:58,630] INFO MediaScannerService - Scanned media library with 750 entries.
[2014-10-30 03:01:21,405] INFO MediaScannerService - Scanned media library with 1000 entries.
[2014-10-30 03:01:48,385] INFO MediaScannerService - Scanned media library with 1250 entries.
[2014-10-30 03:02:19,371] INFO MediaScannerService - Scanned media library with 1500 entries.
[2014-10-30 03:02:52,312] INFO MediaScannerService - Scanned media library with 1750 entries.
[2014-10-30 03:04:39,289] ERROR MediaScannerService - Failed to scan media library.
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 03:04:58,196] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 03:05:17,980] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 05:05:55,875] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 05:06:34,805] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 06:58:06,942] INFO PodcastService - Starting scheduled Podcast refresh.
[2014-10-30 06:58:06,942] INFO PodcastService - Completed scheduled Podcast refresh.
[2014-10-30 07:07:11,056] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 07:07:52,753] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 09:08:26,862] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 09:09:10,688] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 11:09:48,103] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 11:10:34,284] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 13:11:14,318] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 13:12:00,245] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 15:12:31,989] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 15:13:18,344] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 17:13:51,787] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 17:14:34,664] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 19:15:08,754] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 19:15:56,028] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 21:16:32,609] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 21:17:21,121] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 23:17:56,282] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-30 23:18:48,174] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-31 01:19:22,202] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-31 01:20:15,046] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-31 03:20:46,518] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-31 03:21:25,956] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-31 05:22:01,750] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-31 05:22:53,823] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-31 06:58:06,942] INFO PodcastService - Starting scheduled Podcast refresh.
[2014-10-31 06:58:06,945] INFO PodcastService - Completed scheduled Podcast refresh.
[2014-10-31 07:23:27,298] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-31 07:24:15,882] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-31 09:24:55,601] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-31 09:25:45,414] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-10-31 11:26:24,250] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-10-31 11:26:40,595] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

Unfortunately I didn't grab the whole log file, and have since restarted the service so the new one doesn't have errors. I can attach the full log file the next time it crashes.

Anybody have any ideas? Thanks much!

-Bob

Re: Ubuntu - Java OutOfMemoryError

PostPosted: Sat Nov 01, 2014 5:54 pm
by matka
Just a hunch, are you running default java 1.7 ?
Code: Select all
java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.14.04.1)
OpenJDK Server VM (build 24.65-b04, mixed mode)

There is a sticky regarding its incompatibility. I'm installing 1.6 because of course requirement, here are short instructions if you need it (Mint is a Ubuntu spinoff).
http://forums.linuxmint.com/viewtopic.php?f=197&t=149068

George

Re: Ubuntu - Java OutOfMemoryError

PostPosted: Wed Nov 05, 2014 2:01 am
by orangeshasta
Hi George,

Thanks for the reply. I didn't notice that sticky, but it turns out that I AM actually running java 1.6. Here's the output of the java -version command:

Code: Select all
$ java -version
java version "1.6.0_33"
OpenJDK Runtime Environment (IcedTea6 1.13.5) (6b33-1.13.5-1ubuntu0.14.04)
OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)

Any other ideas? I guess I could try upgrading to 1.7 and see if that helps.

Re: Ubuntu - Java OutOfMemoryError

PostPosted: Wed Nov 05, 2014 4:16 pm
by matka
Just as an additional info, I'm not running ubuntu packaged java 1.6, installed from Oracle.
Code: Select all
george@georgeDesktop ~ $ java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) Server VM (build 20.45-b01, mixed mode)

I have 500+ GB of flac, no scanning issues, --max-memory=200, subsonic5.0 (build 4100) – September 21, 2014

Re: Ubuntu - Java OutOfMemoryError

PostPosted: Thu Nov 06, 2014 7:02 pm
by orangeshasta
Okay, I've switched to Oracle Java (trying 1.8 first, will try 1.6 if it doesn't help) and reduced my max-memory back to 200. I'll post back if I keep having problems.

Thank you!

Re: Ubuntu - Java OutOfMemoryError

PostPosted: Sun Nov 09, 2014 11:11 pm
by orangeshasta
Okay, I tried switching to Oracle Java. I tried version 1.8 AND 1.6, and neither seems to be working. Here are my logs:

Oracle Java 1.8:
Code: Select all
[2014-11-06 13:59:20,820] INFO DaoHelper - Checking database schema.
[2014-11-06 13:59:21,113] INFO DaoHelper - Done checking database schema.
[2014-11-06 13:59:21,232] INFO VersionService - Resolved local Subsonic version to: 5.0
[2014-11-06 13:59:21,486] INFO MediaScannerService - Automatic media library scanning scheduled to run every 1 day(s), starting at Fri Nov 07 03:00:00 EST 2014
[2014-11-06 13:59:21,535] INFO UPnPService - Starting UPnP service...
[2014-11-06 13:59:21,599] INFO PodcastService - Automatic Podcast update scheduled to run every 24 hour(s), starting at Thu Nov 06 14:04:21 EST 2014
[2014-11-06 13:59:21,925] INFO UPnPService - Enabling UPnP/DLNA media server
[2014-11-06 13:59:21,925] INFO UPnPService - Starting UPnP service - Done!
[2014-11-06 13:59:31,547] INFO NetworkService - Deleted port mapping for port 4040
[2014-11-06 14:04:21,596] INFO PodcastService - Starting scheduled Podcast refresh.
[2014-11-06 14:04:21,597] INFO PodcastService - Completed scheduled Podcast refresh.
[2014-11-07 03:00:00,486] INFO MediaScannerService - Starting to scan media library.
[2014-11-07 03:00:01,712] INFO MediaScannerService - Scanned media library with 250 entries.
[2014-11-07 03:00:02,520] INFO MediaScannerService - Scanned media library with 500 entries.
[2014-11-07 03:00:03,241] INFO MediaScannerService - Scanned media library with 750 entries.
[2014-11-07 03:00:04,129] INFO MediaScannerService - Scanned media library with 1000 entries.
[2014-11-07 03:00:04,880] INFO MediaScannerService - Scanned media library with 1250 entries.
[2014-11-07 03:00:05,761] INFO MediaScannerService - Scanned media library with 1500 entries.
[2014-11-07 03:00:06,517] INFO MediaScannerService - Scanned media library with 1750 entries.
[2014-11-07 03:00:07,300] INFO MediaScannerService - Scanned media library with 2000 entries.
[2014-11-07 03:00:08,191] INFO MediaScannerService - Scanned media library with 2250 entries.
[2014-11-07 03:00:08,869] INFO MediaScannerService - Scanned media library with 2500 entries.
[2014-11-07 03:00:09,691] INFO MediaScannerService - Scanned media library with 2750 entries.
[2014-11-07 03:00:10,502] INFO MediaScannerService - Scanned media library with 3000 entries.
[2014-11-07 03:00:11,174] INFO MediaScannerService - Scanned media library with 3250 entries.
[2014-11-07 03:00:12,353] INFO MediaScannerService - Scanned media library with 3500 entries.
[2014-11-07 03:00:13,178] INFO MediaScannerService - Scanned media library with 3750 entries.
[2014-11-07 03:00:13,845] INFO MediaScannerService - Scanned media library with 4000 entries.
[2014-11-07 03:00:14,656] INFO MediaScannerService - Scanned media library with 4250 entries.
[2014-11-07 03:00:15,479] INFO MediaScannerService - Scanned media library with 4500 entries.
[2014-11-07 03:00:16,327] INFO MediaScannerService - Scanned media library with 4750 entries.
[2014-11-07 03:00:17,057] INFO MediaScannerService - Scanned media library with 5000 entries.
[2014-11-07 03:00:17,704] INFO MediaScannerService - Scanned media library with 5250 entries.
[2014-11-07 03:00:18,634] INFO MediaScannerService - Scanned media library with 5500 entries.
[2014-11-07 03:00:19,387] INFO MediaScannerService - Scanned media library with 5750 entries.
[2014-11-07 03:00:19,986] INFO MediaScannerService - Scanned media library with 6000 entries.
[2014-11-07 03:00:20,603] INFO MediaScannerService - Scanned media library with 6250 entries.
[2014-11-07 03:00:21,395] INFO MediaScannerService - Scanned media library with 6500 entries.
[2014-11-07 03:00:22,159] INFO MediaScannerService - Scanned media library with 6750 entries.
[2014-11-07 03:00:22,311] INFO MediaScannerService - Scanned media library with 6825 entries.
[2014-11-07 03:00:22,311] INFO MediaScannerService - Marking non-present files.
[2014-11-07 03:00:22,315] INFO MediaScannerService - Marking non-present artists.
[2014-11-07 03:00:22,316] INFO MediaScannerService - Marking non-present albums.
[2014-11-07 03:00:22,319] INFO MediaScannerService - Completed media library scan.
[2014-11-07 03:00:22,813] INFO PlaylistService - Starting playlist import.
[2014-11-07 03:00:22,813] INFO PlaylistService - Completed playlist import.
[2014-11-07 03:00:22,813] INFO PlaylistService - Starting playlist statistics update.
[2014-11-07 03:00:22,813] INFO PlaylistService - Completed playlist statistics update.

Oracle Java 1.6:
Code: Select all
[2014-11-07 13:57:43,655] INFO DaoHelper - Checking database schema.
[2014-11-07 13:57:48,059] INFO DaoHelper - Done checking database schema.
[2014-11-07 13:57:50,269] INFO VersionService - Resolved local Subsonic version to: 5.0
[2014-11-07 13:57:50,467] INFO MediaScannerService - Automatic media library scanning scheduled to run every 1 day(s), starting at Sat Nov 08 03:00:00 EST 2014
[2014-11-07 13:57:50,496] INFO UPnPService - Starting UPnP service...
[2014-11-07 13:57:50,521] INFO PodcastService - Automatic Podcast update scheduled to run every 24 hour(s), starting at Fri Nov 07 14:02:50 EST 2014
[2014-11-07 13:57:50,964] INFO UPnPService - Enabling UPnP/DLNA media server
[2014-11-07 13:57:50,965] INFO UPnPService - Starting UPnP service - Done!
[2014-11-07 13:58:00,505] INFO NetworkService - Deleted port mapping for port 4040
[2014-11-07 14:02:50,521] INFO PodcastService - Starting scheduled Podcast refresh.
[2014-11-07 14:02:50,522] INFO PodcastService - Completed scheduled Podcast refresh.
[2014-11-08 01:58:09,388] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space
   at sun.security.util.DerValue.encode(DerValue.java:385)
   at sun.security.util.DerValue.toByteArray(DerValue.java:792)
   at sun.security.x509.X509CertImpl.parse(X509CertImpl.java:1706)
   at sun.security.x509.X509CertImpl.<init>(X509CertImpl.java:177)
   at sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:90)
   at java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:305)
   at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:746)
   at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:38)
   at java.security.KeyStore.load(KeyStore.java:1185)
   at com.sun.net.ssl.internal.ssl.TrustManagerFactoryImpl.getCacertsKeyStore(TrustManagerFactoryImpl.java:202)
   at com.sun.net.ssl.internal.ssl.TrustManagerFactoryImpl.engineInit(TrustManagerFactoryImpl.java:31)
   at javax.net.ssl.TrustManagerFactory.init(TrustManagerFactory.java:230)
   at com.sun.net.ssl.internal.ssl.SSLContextImpl.engineInit(SSLContextImpl.java:54)
   at javax.net.ssl.SSLContext.init(SSLContext.java:248)
   at org.apache.http.conn.ssl.SSLSocketFactory.getSocketFactory(SSLSocketFactory.java:172)
   at org.apache.http.impl.conn.SchemeRegistryFactory.createDefault(SchemeRegistryFactory.java:49)
   at org.apache.http.impl.client.AbstractHttpClient.createClientConnectionManager(AbstractHttpClient.java:306)
   at org.apache.http.impl.client.AbstractHttpClient.getConnectionManager(AbstractHttpClient.java:466)
   at org.apache.http.impl.client.AbstractHttpClient.createHttpContext(AbstractHttpClient.java:286)
   at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:851)
   at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
   at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
   at net.sourceforge.subsonic.service.NetworkService$URLRedirectionTask.execute(NetworkService.java:245)
   at net.sourceforge.subsonic.service.NetworkService$Task.run(NetworkService.java:306)
   at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
   at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
   at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
   at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
   at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)

[2014-11-08 01:59:09,939] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 01:59:21,429] WARN SettingsService - Failed to validate license.
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 03:00:00,590] INFO MediaScannerService - Starting to scan media library.
[2014-11-08 03:00:04,036] ERROR MediaScannerService - Failed to scan media library.
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 03:00:04,036] ERROR SearchService - Failed to create search index.
java.lang.IllegalStateException: this writer hit an OutOfMemoryError; cannot flush
   at org.apache.lucene.index.IndexWriter.doFlushInternal(IndexWriter.java:3612)
   at org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:3595)
   at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3585)
   at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:2338)
   at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:2316)
   at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:2286)
   at net.sourceforge.subsonic.service.SearchService.stopIndexing(SearchService.java:154)
   at net.sourceforge.subsonic.service.MediaScannerService.doScanLibrary(MediaScannerService.java:207)
   at net.sourceforge.subsonic.service.MediaScannerService.access$000(MediaScannerService.java:48)
   at net.sourceforge.subsonic.service.MediaScannerService$2.run(MediaScannerService.java:147)

[2014-11-08 03:00:05,471] INFO PlaylistService - Starting playlist import.
[2014-11-08 03:00:05,471] INFO PlaylistService - Completed playlist import.
[2014-11-08 03:00:05,471] INFO PlaylistService - Starting playlist statistics update.
[2014-11-08 03:00:05,471] INFO PlaylistService - Completed playlist statistics update.
[2014-11-08 03:59:26,718] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 03:59:44,462] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 06:00:12,360] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 06:00:26,426] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 08:00:48,165] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 08:01:04,848] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 10:01:16,976] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 10:01:56,786] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 12:02:10,631] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 12:02:43,532] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 14:02:50,988] INFO PodcastService - Starting scheduled Podcast refresh.
[2014-11-08 14:02:54,497] INFO PodcastService - Completed scheduled Podcast refresh.
[2014-11-08 14:03:06,755] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 14:03:39,570] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 16:04:00,408] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 16:04:41,321] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 18:05:08,874] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 18:05:37,744] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 20:06:05,030] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 20:06:55,537] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 22:07:22,184] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-08 22:07:43,083] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-11-09 00:08:06,233] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-09 00:08:29,532] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-11-09 02:09:00,866] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-09 02:09:27,836] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-11-09 03:00:00,715] INFO MediaScannerService - Starting to scan media library.
[2014-11-09 03:00:05,688] ERROR MediaScannerService - Failed to scan media library.
java.lang.OutOfMemoryError: Java heap space

[2014-11-09 03:00:05,689] ERROR SearchService - Failed to create search index.
java.lang.IllegalStateException: this writer hit an OutOfMemoryError; cannot flush
   at org.apache.lucene.index.IndexWriter.doFlushInternal(IndexWriter.java:3612)
   at org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:3595)
   at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3585)
   at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:2338)
   at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:2316)
   at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:2286)
   at net.sourceforge.subsonic.service.SearchService.stopIndexing(SearchService.java:154)
   at net.sourceforge.subsonic.service.MediaScannerService.doScanLibrary(MediaScannerService.java:207)
   at net.sourceforge.subsonic.service.MediaScannerService.access$000(MediaScannerService.java:48)
   at net.sourceforge.subsonic.service.MediaScannerService$2.run(MediaScannerService.java:147)

[2014-11-09 03:00:06,333] INFO PlaylistService - Starting playlist import.
[2014-11-09 03:00:06,333] INFO PlaylistService - Completed playlist import.
[2014-11-09 03:00:06,333] INFO PlaylistService - Starting playlist statistics update.
[2014-11-09 03:00:06,618] INFO PlaylistService - Completed playlist statistics update.
[2014-11-09 04:09:43,767] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-09 04:10:06,412] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-11-09 06:10:20,929] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-09 06:10:31,115] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-11-09 08:10:46,947] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-09 08:11:12,729] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

[2014-11-09 10:11:36,230] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-09 10:11:55,383] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

What's interesting is that I only got the OutOfMemoryError with Java 1.6. Java 1.8 didn't show any errors in the log. And yet, Subsonic still wouldn't respond on its assigned port after about a day or so. Is there anything else I should try? What might I be able to do to debug the problem with 1.8 if there aren't any errors in the log?

Bob

Re: Ubuntu - Java OutOfMemoryError

PostPosted: Tue Nov 11, 2014 3:54 pm
by orangeshasta
Okay, I may have spoken too soon about Oracle Java 1.8. I do, in fact, get the OutOfMemoryError when I'm using that one as well. Selection from the log file is below:
Code: Select all
[2014-11-11 03:00:00,624] INFO MediaScannerService - Starting to scan media library.
[2014-11-11 03:00:00,955] INFO MediaScannerService - Scanned media library with 250 entries.
[2014-11-11 03:00:01,190] INFO MediaScannerService - Scanned media library with 500 entries.
[2014-11-11 03:00:01,341] INFO MediaScannerService - Scanned media library with 750 entries.
[2014-11-11 03:00:01,484] INFO MediaScannerService - Scanned media library with 1000 entries.
[2014-11-11 03:00:01,804] INFO MediaScannerService - Scanned media library with 1250 entries.
[2014-11-11 03:00:01,937] INFO MediaScannerService - Scanned media library with 1500 entries.
[2014-11-11 03:00:02,058] INFO MediaScannerService - Scanned media library with 1750 entries.
[2014-11-11 03:00:02,176] INFO MediaScannerService - Scanned media library with 2000 entries.
[2014-11-11 03:00:02,289] INFO MediaScannerService - Scanned media library with 2250 entries.
[2014-11-11 03:00:02,421] INFO MediaScannerService - Scanned media library with 2500 entries.
[2014-11-11 03:00:02,542] INFO MediaScannerService - Scanned media library with 2750 entries.
[2014-11-11 03:00:02,650] INFO MediaScannerService - Scanned media library with 3000 entries.
[2014-11-11 03:00:02,764] INFO MediaScannerService - Scanned media library with 3250 entries.
[2014-11-11 03:00:02,887] INFO MediaScannerService - Scanned media library with 3500 entries.
[2014-11-11 03:00:03,001] INFO MediaScannerService - Scanned media library with 3750 entries.
[2014-11-11 03:00:03,119] INFO MediaScannerService - Scanned media library with 4000 entries.
[2014-11-11 03:00:03,224] INFO MediaScannerService - Scanned media library with 4250 entries.
[2014-11-11 03:00:03,340] INFO MediaScannerService - Scanned media library with 4500 entries.
[2014-11-11 03:00:03,445] INFO MediaScannerService - Scanned media library with 4750 entries.
[2014-11-11 03:00:03,544] INFO MediaScannerService - Scanned media library with 5000 entries.
[2014-11-11 03:00:03,628] INFO MediaScannerService - Scanned media library with 5250 entries.
[2014-11-11 03:00:03,730] INFO MediaScannerService - Scanned media library with 5500 entries.
[2014-11-11 03:00:03,822] INFO MediaScannerService - Scanned media library with 5750 entries.
[2014-11-11 03:00:03,917] INFO MediaScannerService - Scanned media library with 6000 entries.
[2014-11-11 03:00:04,008] INFO MediaScannerService - Scanned media library with 6250 entries.
[2014-11-11 03:00:04,101] INFO MediaScannerService - Scanned media library with 6500 entries.
[2014-11-11 03:00:04,181] INFO MediaScannerService - Scanned media library with 6750 entries.
[2014-11-11 03:00:04,205] INFO MediaScannerService - Scanned media library with 6825 entries.
[2014-11-11 03:00:04,205] INFO MediaScannerService - Marking non-present files.
[2014-11-11 03:00:04,211] INFO MediaScannerService - Marking non-present artists.
[2014-11-11 03:00:04,212] INFO MediaScannerService - Marking non-present albums.
[2014-11-11 03:00:04,215] INFO MediaScannerService - Completed media library scan.
[2014-11-11 03:00:04,641] INFO PlaylistService - Starting playlist import.
[2014-11-11 03:00:04,641] INFO PlaylistService - Completed playlist import.
[2014-11-11 03:00:04,641] INFO PlaylistService - Starting playlist statistics update.
[2014-11-11 03:00:04,641] INFO PlaylistService - Completed playlist statistics update.
[2014-11-11 07:26:19,138] ERROR SearchService - Failed to search or random songs.
java.lang.OutOfMemoryError: Java heap space
   at org.apache.lucene.search.HitQueue.getSentinelObject(HitQueue.java:76)
   at org.apache.lucene.search.HitQueue.getSentinelObject(HitQueue.java:22)
   at org.apache.lucene.util.PriorityQueue.initialize(PriorityQueue.java:113)
   at org.apache.lucene.search.HitQueue.<init>(HitQueue.java:67)
   at org.apache.lucene.search.TopScoreDocCollector.<init>(TopScoreDocCollector.java:126)
   at org.apache.lucene.search.TopScoreDocCollector.<init>(TopScoreDocCollector.java:37)
   at org.apache.lucene.search.TopScoreDocCollector$InOrderTopScoreDocCollector.<init>(TopScoreDocCollector.java:42)
   at org.apache.lucene.search.TopScoreDocCollector$InOrderTopScoreDocCollector.<init>(TopScoreDocCollector.java:40)
   at org.apache.lucene.search.TopScoreDocCollector.create(TopScoreDocCollector.java:113)
   at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:169)
   at org.apache.lucene.search.Searcher.search(Searcher.java:98)
   at net.sourceforge.subsonic.service.SearchService.getRandomSongs(SearchService.java:254)
   at net.sourceforge.subsonic.controller.RESTController.getRandomSongs(RESTController.java:998)
   at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:483)
   at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:473)
   at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:410)
   at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
   at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
   at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:81)
   at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:148)
   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)

[2014-11-11 07:28:08,292] ERROR SearchService - Failed to search or random songs.
java.lang.OutOfMemoryError: Java heap space
   at org.apache.lucene.search.HitQueue.getSentinelObject(HitQueue.java:76)
   at org.apache.lucene.search.HitQueue.getSentinelObject(HitQueue.java:22)
   at org.apache.lucene.util.PriorityQueue.initialize(PriorityQueue.java:113)
   at org.apache.lucene.search.HitQueue.<init>(HitQueue.java:67)
   at org.apache.lucene.search.TopScoreDocCollector.<init>(TopScoreDocCollector.java:126)
   at org.apache.lucene.search.TopScoreDocCollector.<init>(TopScoreDocCollector.java:37)
   at org.apache.lucene.search.TopScoreDocCollector$InOrderTopScoreDocCollector.<init>(TopScoreDocCollector.java:42)
   at org.apache.lucene.search.TopScoreDocCollector$InOrderTopScoreDocCollector.<init>(TopScoreDocCollector.java:40)
   at org.apache.lucene.search.TopScoreDocCollector.create(TopScoreDocCollector.java:113)
   at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:169)
   at org.apache.lucene.search.Searcher.search(Searcher.java:98)
   at net.sourceforge.subsonic.service.SearchService.getRandomSongs(SearchService.java:254)
   at net.sourceforge.subsonic.controller.RESTController.getRandomSongs(RESTController.java:998)
   at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:483)
   at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:473)
   at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:410)
   at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
   at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
   at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
   at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:81)
   at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:148)
   at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
   at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)

[2014-11-11 07:28:42,318] ERROR SearchService - Failed to search or random songs.
java.lang.OutOfMemoryError: Java heap space

[2014-11-11 08:37:41,392] WARN NetworkService - Failed to register web address.
java.lang.OutOfMemoryError: Java heap space

[2014-11-11 08:44:43,963] ERROR NetworkService - Error executing URLRedirectionTask: Java heap space
java.lang.OutOfMemoryError: Java heap space

Does anyone have any idea of something else I could try? This is so frustrating, I'd really like to get Subsonic working again.

-Bob

Re: Ubuntu - Java OutOfMemoryError

PostPosted: Sat Nov 15, 2014 6:12 am
by Chad
I was having this issue and it seemed to go away after I stopped having it scan folders nightly. I have not been adding that much recently so I have it scan weekly and if I add a bunch of media I just manually scan after uploading or adding via sftp. If it were to happen I feel that the time interval that I have to reboot from kernel updates supercedes the glitch it was having.

It also never hurts to set SSH up and run a client on a mobile device or use Putty on a computer. This way you can just sudo reboot the Bad Oscar when you have to. My server is headless for the most part.

Re: Ubuntu - Java OutOfMemoryError

PostPosted: Fri Jan 02, 2015 11:32 pm
by sindre_mehus
Does this also happen with Subsonic 5.1.beta1? This has an updated version of a UPnP java library I'm using, and I'm suspecting it had a memory leak in the old version.

Re: Ubuntu - Java OutOfMemoryError

PostPosted: Sat Jan 03, 2015 6:40 pm
by orangeshasta
I'll check that out - I just noticed yesterday that there was a new beta posted. I have installed it, and will report back in a few days with my findings.

Thanks!

Re: Ubuntu - Java OutOfMemoryError

PostPosted: Mon Jan 05, 2015 2:15 pm
by orangeshasta
Well, it happened again - I installed the latest beta on Saturday, and it crashed sometime last night. I tried to paste the entire log file for completeness, but it's making my post too large so I attached the file instead.

Any other ideas?

Thanks,
Bob

Re: Ubuntu - Java OutOfMemoryError

PostPosted: Mon Jan 05, 2015 3:45 pm
by sindre_mehus
Thanks!

I noticed this in the log:

[2015-01-03 13:42:55,155] ERROR DaoHelper - Failed to initialize database.
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is java.sql.SQLException: The database is already in use by another process: org.hsqldb.persist.NIOLockFile@2d6451a6[file =/var/subsonic/db/subsonic.lck, exists=true, locked=false, valid=false, fl =null]: java.lang.Exception: checkHeartbeat(): lock file [/var/subsonic/db/subsonic.lck] is presumably locked by another process.

Try restarting and see if this error goes away. If not, try to remove the lock file /var/subsonic/db/subsonic.lck

After that - if you still have problems - the next step is to create a heap dump and send it to me for analysis. This is done by the "jmap" tool (part of Java), e.g., "jmap -F -dump:file=subsonic.hprof <pid>". This should be done after the server has run for some time, for the memory leak to take effect.

Sindre

Re: Ubuntu - Java OutOfMemoryError

PostPosted: Mon Jan 05, 2015 4:03 pm
by orangeshasta
Okay, I'll do that. I restarted the server, which seemed to get rid of the database initialization error. I did get some other errors on startup (license validation), but after restarting the subsonic service again I had no problem (It may have tried to start before the internet connection was up).

If/when it crashes again, I'll do a heap dump and send it along. Thanks for your help!

Re: Ubuntu - Java OutOfMemoryError

PostPosted: Wed Jan 07, 2015 3:00 pm
by orangeshasta
Okay, subsonic has crashed again (log is attached). I tried running jmap to try and do a heap dump, but it seems like it's not creating an output file. I do get an error message when I run it:

Code: Select all
bob@BobServer:~$ sudo jmap -F -dump:file=~/subsonic.hprof 2469
Attaching to process ID 2469, please wait...
Exception in thread "main" java.lang.reflect.InvocationTargetException
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at sun.tools.jmap.JMap.runTool(JMap.java:179)
   at sun.tools.jmap.JMap.main(JMap.java:110)
Caused by: java.lang.RuntimeException: Type "Klass*", referenced in VMStructs::localHotSpotVMStructs in the remote VM, was not present in the remote VMStructs::localHotSpotVMTypes table (should have been caught in the debug build of that VM). Can not continue.
   at sun.jvm.hotspot.HotSpotTypeDataBase.lookupOrFail(HotSpotTypeDataBase.java:362)
   at sun.jvm.hotspot.HotSpotTypeDataBase.readVMStructs(HotSpotTypeDataBase.java:253)
   at sun.jvm.hotspot.HotSpotTypeDataBase.<init>(HotSpotTypeDataBase.java:87)
   at sun.jvm.hotspot.bugspot.BugSpotAgent.setupVM(BugSpotAgent.java:568)
   at sun.jvm.hotspot.bugspot.BugSpotAgent.go(BugSpotAgent.java:494)
   at sun.jvm.hotspot.bugspot.BugSpotAgent.attach(BugSpotAgent.java:332)
   at sun.jvm.hotspot.tools.Tool.start(Tool.java:163)
   at sun.jvm.hotspot.tools.HeapDumper.main(HeapDumper.java:77)
   ... 6 more


...though I suspect this might be an error generated by jmap, rather than the output we're looking for. I tried running it without "sudo" (as the user who is the process owner) and got this output:

Code: Select all
Attaching to process ID 2469, please wait...
Error attaching to process: sun.jvm.hotspot.debugger.DebuggerException: Can't attach to the process


Any ideas based on that? Maybe there's something wrong with my Java installation?

-Bob

Re: Ubuntu - Java OutOfMemoryError

PostPosted: Wed Jan 07, 2015 7:35 pm
by sindre_mehus
If you run Java 6, I recommend upgrading to Java 7. Maybe jmap works better then.

Sindre