question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Java heap space error caused by ApexIndexer

See original GitHub issue

Hello,

Unfortunately the same issue as #1103 is still exiting. I’m unable to load the @isTest panel and the code completion is not working. Here is the complete log generated when I tried to run a test from VSCode for example:

10:16:27.791 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Patching standard library for System.Database.* methods 10:16:27.800 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Done patching standard library for System.Database.* methods 10:16:29.740 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Scanning built-in and system Apex types took 7367 ms. 10:16:29.744 [ApexIndexer STARTING] INFO a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Scanning user-defined types. sept. 03, 2019 10:18:07 AM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError GRAVE: Internal error: java.lang.reflect.InvocationTargetException java.lang.RuntimeException: java.lang.reflect.InvocationTargetException at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:67) at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.request(GenericEndpoint.java:120) at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleRequest(RemoteEndpoint.java:261) at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:190) at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:192) at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94) at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:99) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65) ... 11 more Caused by: java.lang.OutOfMemoryError: Java heap space

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
stohn777commented, Nov 8, 2019

@ntotten Carrying over from the SF Success Community question. The error above is somewhat similar to the ones that we get when opening org that have a very large number of metadata artifacts.

From yesterday when I re-opened a massive-org project … 12:36:54.324 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Scanning built-in and system Apex types. Nov 07, 2019 12:36:55 PM apex.jorje.parser.impl.BaseApexLexer dedupe INFO: Deduped array ApexLexer.DFA22_transition. Found 7075527 shorts which is 13MB not including array overhead. Removed 6418975 shorts which is 12MB not counting array overhead. Took 9 ms. 12:36:59.076 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Patching standard library for System.Database.* methods 12:36:59.084 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Done patching standard library for System.Database.* methods 12:37:00.545 [ApexIndexer STARTING] INFO a.jorje.lsp.impl.index.ApexIndexer - ApexIndexer: Scanning user-defined types. 12:37:00.548 [Apex Prelude Service STARTING] INFO a.j.l.i.s.ApexPreludeManagedService - Scanning built-in and system Apex types took 6223 ms. Exception in thread "ForkJoinPool.commonPool-worker-27" java.lang.OutOfMemoryError: Java heap space

0reactions
AntunBartonicekcommented, Mar 5, 2021

Hi @AntunBartonicek - You’re right that more memory isn’t a silver bullet and it doesn’t help in all cases. We are still seeing issues when indexing large projects and are tracking on #2410

Thanks…

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to deal with "java.lang.OutOfMemoryError: Java heap ...
Recently, I am running into java.lang.OutOfMemoryError: Java heap space error because I am not being conservative on memory usage. The user can open...
Read more >
Java Heap Space - Data Loader Error - Salesforce Developers
I was able to resolve the 'Java Heap Space' error. It appears to be have been caused by a corrupted .csv file that...
Read more >
java.lang.OutOfMemoryError: Java heap space Apex Listener ...
Hi, I have an application with Apex 4.2 and I'm running the listener in standalone mode, I've tried with the new version of...
Read more >
Error: OutOfMemoryError: Java heap space - Commvault
Causes. Approximately 2 GB of heap memory is needed to download 1 million files. If you download more than 1 millions files and...
Read more >
Eclipse New Project Error: OutOfMemoryError: Java heap space
I have also faced this issue many time. You can do one thing .Once you get this error now change radio button to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found