Bitcoin Forum

Bitcoin => Project Development => Topic started by: stathmarxis on June 20, 2025, 02:12:08 PM



Title: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaS
Post by: stathmarxis on June 20, 2025, 02:12:08 PM
i am using this repor locally https://github.com/janoside/btc-rpc-explorer
and after many rpc requests I got the following heap problem


btc-rpc-explorer   | <--- JS stacktrace --->
btc-rpc-explorer   |
btc-rpc-explorer   | FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
btc-rpc-explorer   | ----- Native stack trace -----


this is my setup:

      BTCEXP_HOST=192.168.1.222
      BTCEXP_PORT=3002
      BTCEXP_ADDRESS_API=electrum
      BTCEXP_ELECTRUM_SERVERS=tcp://192.168.1.223:50001
      BTCEXP_ELECTRUM_TXINDEX=false
      BTCEXP_BITCOIND_URI: $BTCEXP_BITCOIND_URI
      BTCEXP_BITCOIND_USER: $BTCEXP_BITCOIND_USER
      BTCEXP_BITCOIND_PASS: $BTCEXP_BITCOIND_PASS
      BTCEXP_BITCOIND_RPC_TIMEOUT: $BTCEXP_BITCOIND_RPC_TIMEOUT
      BTCEXP_SECURE_SITE=false
      BTCEXP_COIN=BTC
      BTCEXP_RPC_CONCURRENCY: 16
      BTCEXP_SLOW_DEVICE_MODE=false
      BTCEXP_NO_RATES=true
      BTCEXP_RPC_ALLOWALL=true
      BTCEXP_UI_TIMEZONE=local
      BTCEXP_UI_THEME=dark
      BTCEXP_OLD_SPACE_MAX_SIZE=8192
      BTCEXP_NO_INMEMORY_RPC_CACHE: true


Title: Re: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaS
Post by: ABCbits on June 21, 2025, 10:35:51 AM
I noticed you've also opened issue about it on their GitHub under different username[1]. So while you're waiting for reply from the developer over there, do you have RAM usage log on your system? If yes, is the RAM about to be fully used when the error happened?

[1] https://github.com/janoside/btc-rpc-explorer/issues/744 (https://github.com/janoside/btc-rpc-explorer/issues/744)


Title: Re: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaS
Post by: NotATether on July 20, 2025, 03:15:17 PM
It looks like the JVM ran out of memory from its heap, so you might have to pass  (e.g.) -Xms8g (to throw 8GB of ram at the application) and -Xmx8g.

One is for the default heap size to allocate immediately, the other is the hard maximum to let Java use.

Of course, I could be wrong, but perhaps if you post the full stack trace, we can see the problem more clearly.


Title: Re: FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaS
Post by: ABCbits on July 21, 2025, 09:23:20 AM
i am using this repor locally https://github.com/janoside/btc-rpc-explorer
and after many rpc requests I got the following heap problem

I forget to mention it earlier, but you may want to consider getting getting data you need directly from Bitcoin Core or Electrum server that you already run as workaround.

It looks like the JVM ran out of memory from its heap, so you might have to pass  (e.g.) -Xms8g (to throw 8GB of ram at the application) and -Xmx8g.

One is for the default heap size to allocate immediately, the other is the hard maximum to let Java use.

Of course, I could be wrong, but perhaps if you post the full stack trace, we can see the problem more clearly.

I think you mistook JavaScript for Java. 2 of them are different programming language.