How to Fix "java.lang.OutOfMemoryError: Java heap space"

I installed BitBucket 5.4.0.

I keep getting this error when I start the server.

This is an OOB install, nothing added.

I am trying to install a user plugin, but I also get this

error when I upload it.

How can I fix the OOM error. I have tried setting various env variables

to a larger size but nothing works.

Thanks

 

 

1 answer

1 accepted

0 vote

How much memory have you allocated, and what is the first 5-6 lines of the error you see in the log when it runs out of memory?

at this time I am using the default that comes with BitBucket.

I have tried increasing mem to 512, 1024 but same error.

I have 13g available.

Here is the log when I try to upload my plugin.

 

2017-10-27 13:59:04,615 INFO  [main]  c.a.b.i.b.BitbucketServerApplication Starting BitbucketServerApplication on sensu01-F8987 with PID 3088 (C:\Atlassian\Bitbucket\5.4.0\app\WEB-INF\classes started by atlbitbucket in C:\Atlassian\Bitbucket\5.4.0\app)
2017-10-27 13:59:04,615 INFO  [main]  c.a.b.i.b.BitbucketServerApplication No active profile set, falling back to default profiles: default
2017-10-27 13:59:06,537 INFO  [main]  c.a.b.i.boot.log.BuildInfoLogger Starting Bitbucket 5.4.0 (9d5666b built on Tue Sep 19 00:26:24 EDT 2017)
2017-10-27 13:59:06,537 INFO  [main]  c.a.b.i.boot.log.BuildInfoLogger JVM: Oracle Corporation Java HotSpot(TM) 64-Bit Server VM 1.8.0_102-b14
2017-10-27 13:59:09,522 INFO  [main]  c.a.b.i.b.BitbucketServerApplication Started BitbucketServerApplication in 7.61 seconds (JVM running for 11.274)
2017-10-27 13:59:18,943 INFO  [spring-startup]  c.a.s.internal.home.HomeLockAcquirer Successfully acquired lock on home directory C:\Atlassian\ApplicationData\Bitbucket
2017-10-27 13:59:34,112 INFO  [spring-startup]  c.a.s.internal.home.HomeLockAcquirer Successfully acquired lock on home directory C:\Atlassian\ApplicationData\Bitbucket\shared
2017-10-27 13:59:38,924 WARN  [spring-startup]  com.hazelcast.instance.Node [10.242.22.117]:5701 [atlbitbucket] [3.7.4-atlassian-43] No join method is enabled! Starting standalone.
2017-10-27 14:00:18,034 INFO  [spring-startup]  c.a.s.i.hook.DefaultHookService Hook callback socket listening on 127.0.0.1:53759
2017-10-27 14:00:37,221 WARN  [ThreadPoolAsyncTaskExecutor::Thread 9]  c.a.p.s.s.util.ProductFilterUtil Couldn't detect product, will use ProductFilter.ALL
2017-10-27 14:00:38,096 WARN  [ThreadPoolAsyncTaskExecutor::Thread 11]  c.a.p.s.s.util.ProductFilterUtil Couldn't detect product, will use ProductFilter.ALL
2017-10-27 14:00:38,159 WARN  [ThreadPoolAsyncTaskExecutor::Thread 8]  c.a.p.s.s.util.ProductFilterUtil Couldn't detect product, will use ProductFilter.ALL
2017-10-27 14:00:39,112 INFO  [ThreadPoolAsyncTaskExecutor::Thread 15]  c.a.s.i.s.g.t.DefaultTranscodeServer Callback socket listening at 127.0.0.1:53787
2017-10-27 14:00:50,659 WARN  [spring-startup]  c.a.s.i.p.s.OsgiBundledPathScanner Cannot scan directory /com/atlassian/oauth/shared/servlet/ in bundle com.atlassian.oauth.atlassian-oauth-service-provider-plugin; it does not exist
2017-10-27 14:00:53,096 INFO  [spring-startup]  c.a.b.internal.ssh.server.SshServer Starting SSH server on port 7999...
2017-10-27 14:00:53,143 INFO  [spring-startup]  c.a.b.internal.ssh.server.SshServer Started SSH server successfully.
2017-10-27 14:00:53,159 INFO  [spring-startup]  c.a.b.s.i.c.DefaultClusterJobManager Registering job for StartupChecksJob
2017-10-27 14:00:53,190 INFO  [spring-startup]  c.a.b.s.i.c.DefaultClusterJobManager Registering job for ElasticsearchSynchronizeJob
2017-10-27 14:00:53,190 INFO  [spring-startup]  c.a.b.s.j.c.i.HealthCheckRunner New health check registered: KnownIssueCheck
2017-10-27 14:00:53,315 INFO  [spring-startup]  c.a.b.s.j.c.i.HealthCheckRunner New health check registered: AuthenticationCheck
2017-10-27 14:00:53,315 INFO  [spring-startup]  c.a.b.s.j.c.i.HealthCheckRunner New health check registered: SearchIndexCheck
2017-10-27 14:00:53,315 INFO  [spring-startup]  c.a.b.s.i.i.e.DefaultIndexEventQueueProcessor Event queue processor has been started
2017-10-27 14:00:53,784 INFO  [spring-startup]  c.a.s.internal.scm.PluginScmService Bitbucket is using C:\Program Files\Git\cmd\git.exe version 2.14.1
2017-10-27 14:00:53,924 INFO  [spring-startup]  c.a.s.i.hazelcast.HazelcastLifecycle Updating Hazelcast instance capabilities
2017-10-27 14:00:56,440 WARN  [UpmScheduler:thread-1]  com.atlassian.upm.pac.PacClientImpl Update check request may take longer because of the number of add-ons
2017-10-27 14:01:03,034 INFO  [Caesium-1-3]  c.a.b.s.j.c.i.HealthCheckRunner Running up to 3 search health checks
2017-10-27 14:01:03,175 INFO  [Caesium-1-1]  c.a.b.s.i.i.jobs.StartupChecksJob Attempting provisioning in startup job
2017-10-27 14:01:03,175 INFO  [I/O dispatcher 1]  c.a.b.s.s.t.DefaultElasticsearchConnectionTester Connected to Elasticsearch version 2.3.1
2017-10-27 14:01:03,175 INFO  [Caesium-1-1]  c.a.b.s.i.i.jobs.StartupChecksJob Running startup jobs for search
2017-10-27 14:01:03,253 INFO  [Caesium-1-3]  c.a.b.s.j.c.i.HealthCheckRunner Health checks will run again after PT5M
2017-10-27 14:01:31,977 WARN  [http-nio-7990-exec-7] admin @1TAX2MIx841x34x5 1hu7cvu 0:0:0:0:0:0:0:1 "GET /rest/plugins/1.0/installed-marketplace HTTP/1.1" com.atlassian.upm.pac.PacClientImpl Update check request may take longer because of the number of add-ons
2017-10-27 14:02:11,031 ERROR [UpmAsynchronousTaskManager:thread-2] admin @1TAX2MIx842x40x0 1hu7cvu 0:0:0:0:0:0:0:1 "POST /rest/plugins/1.0/ HTTP/1.1" c.a.p.loaders.ScanningPluginLoader Unable to deploy plugin '${atlassian.plugin.key}' from 'Unit: C:\Atlassian\ApplicationData\Bitbucket\shared\plugins\installed-plugins\plugin_4781599035713403811_EndevorPlugin.jar (1509127325625)'.
2017-10-27 14:02:11,031 ERROR [UpmAsynchronousTaskManager:thread-2] admin @1TAX2MIx842x40x0 1hu7cvu 0:0:0:0:0:0:0:1 "POST /rest/plugins/1.0/ HTTP/1.1" c.a.p.loaders.ScanningPluginLoader Because of the following exception:
java.lang.OutOfMemoryError: Java heap space
 at java.util.Arrays.copyOf(Arrays.java:3332)
 at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
 at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
 at java.lang.StringBuilder.append(StringBuilder.java:136)
 at java.lang.StringBuilder.append(StringBuilder.java:76)
 at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:484)
 at java.lang.StringBuilder.append(StringBuilder.java:166)
 at java.lang.StringBuilder.append(StringBuilder.java:76)
 at java.util.Formatter$FormatSpecifier.print(Formatter.java:2769)
 at java.util.Formatter.format(Formatter.java:2508)
 at java.util.Formatter.format(Formatter.java:2455)
 at java.lang.String.format(String.java:2940)
 at aQute.bnd.osgi.Processor.report(Processor.java:1799)
 at aQute.bnd.osgi.Processor.toString(Processor.java:2235)
 at java.util.Formatter$FormatSpecifier.printString(Formatter.java:2886)
 at java.util.Formatter$FormatSpecifier.print(Formatter.java:2763)
 at java.util.Formatter.format(Formatter.java:2520)
 at java.util.Formatter.format(Formatter.java:2455)
 at java.lang.String.format(String.java:2940)
 at aQute.bnd.osgi.Processor.formatArrays(Processor.java:1905)
 at aQute.bnd.osgi.Processor.warning(Processor.java:170)
 at aQute.bnd.osgi.Macro.replace(Macro.java:228)
 at aQute.bnd.osgi.Macro.process(Macro.java:73)
 at aQute.bnd.osgi.Macro.process(Macro.java:89)
 at aQute.bnd.osgi.Macro.process(Macro.java:59)
 at aQute.bnd.osgi.Macro.process(Macro.java:54)
 at aQute.bnd.osgi.Processor.getProperty(Processor.java:1189)
 at aQute.bnd.osgi.Processor.getProperty(Processor.java:1135)
 at aQute.bnd.osgi.Processor.getProperty(Processor.java:826)
 at aQute.bnd.osgi.AnnotationHeaders.getHeader(AnnotationHeaders.java:360)
 at aQute.bnd.osgi.Analyzer.doHeader(Analyzer.java:891)
 at aQute.bnd.osgi.Analyzer.calcManifest(Analyzer.java:769)
2017-10-27 14:02:11,117 WARN  [UpmAsynchronousTaskManager:thread-2] admin @1TAX2MIx842x40x0 1hu7cvu 0:0:0:0:0:0:0:1 "POST /rest/plugins/1.0/ HTTP/1.1" c.a.u.c.i.DefaultPluginInstallationService Plugin installation failed: Unknown error, plugin not installed
2017-10-27 14:02:11,117 WARN  [UpmAsynchronousTaskManager:thread-2] admin @1TAX2MIx842x40x0 1hu7cvu 0:0:0:0:0:0:0:1 "POST /rest/plugins/1.0/ HTTP/1.1" c.a.u.c.i.DefaultPluginInstallationService com.atlassian.upm.spi.PluginInstallException: Unknown error, plugin not installed
com.atlassian.upm.spi.PluginInstallException: Unknown error, plugin not installed
 at com.atlassian.upm.core.install.AbstractPluginInstallHandler.installArtifact(AbstractPluginInstallHandler.java:122)
 at com.atlassian.upm.core.install.JarPluginInstallHandler.installPluginInternal(JarPluginInstallHandler.java:52)
 at com.atlassian.upm.core.install.AbstractPluginInstallHandler.installPlugin(AbstractPluginInstallHandler.java:60)
 at com.atlassian.upm.core.install.DefaultPluginInstallationService.execute(DefaultPluginInstallationService.java:117)
 at com.atlassian.upm.core.install.DefaultPluginInstallationService.install(DefaultPluginInstallationService.java:91)
 at com.atlassian.upm.install.UpmPluginInstallationService.install(UpmPluginInstallationService.java:97)
 at com.atlassian.upm.core.rest.resources.install.InstallTask.installFromFile(InstallTask.java:156)
 at com.atlassian.upm.core.rest.resources.install.InstallFromFileTask.executeTask(InstallFromFileTask.java:37)
 at com.atlassian.upm.core.rest.resources.install.InstallTask.run(InstallTask.java:81)
 at com.atlassian.upm.core.async.AsynchronousTaskManager.executeTask(AsynchronousTaskManager.java:124)
 at com.atlassian.upm.core.async.AsynchronousTaskManager$1.call(AsynchronousTaskManager.java:102)
 at com.atlassian.upm.core.async.AsynchronousTaskManager$1.call(AsynchronousTaskManager.java:99)
 at com.atlassian.sal.core.executor.ThreadLocalDelegateCallable.call(ThreadLocalDelegateCallable.java:38)
 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.lang.Thread.run(Thread.java:745)
 ... 1 frame trimmed

Never mind.

User Error!

I installed a  jar built by ant.

Using maven it installed fine

sorry for the false alarm

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,872 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you