labuladong opened a new issue, #18206:
URL: https://github.com/apache/pulsar/issues/18206

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/pulsar/issues) 
and found nothing similar.
   
   
   ### Version
   
   The master version of Pulsar.
   
   ### Minimal reproduce step
   
   1. `rm data` to clean the old standalone data folder.
   
   2. Start Pulsar standalone with multiple bookies.
   
   ```java
   bin/pulsar standalone --num-bookies 3
   ```
   
   
   ### What did you expect to see?
   
   Start normally.
   
   ### What did you see instead?
   
   ```java
   io.netty.util.internal.OutOfDirectMemoryError: failed to allocate 1073741824 
byte(s) of direct memory (used: 7516258304, max: 8589934592)
        at 
io.netty.util.internal.PlatformDependent.incrementMemoryCounter(PlatformDependent.java:806)
 ~[io.netty-netty-common-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.util.internal.PlatformDependent.allocateDirectNoCleaner(PlatformDependent.java:735)
 ~[io.netty-netty-common-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.buffer.UnpooledUnsafeNoCleanerDirectByteBuf.allocateDirect(UnpooledUnsafeNoCleanerDirectByteBuf.java:30)
 ~[io.netty-netty-buffer-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.buffer.UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeNoCleanerDirectByteBuf.allocateDirect(UnpooledByteBufAllocator.java:186)
 ~[io.netty-netty-buffer-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.buffer.UnpooledDirectByteBuf.<init>(UnpooledDirectByteBuf.java:64) 
~[io.netty-netty-buffer-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.buffer.UnpooledUnsafeDirectByteBuf.<init>(UnpooledUnsafeDirectByteBuf.java:41)
 ~[io.netty-netty-buffer-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.buffer.UnpooledUnsafeNoCleanerDirectByteBuf.<init>(UnpooledUnsafeNoCleanerDirectByteBuf.java:25)
 ~[io.netty-netty-buffer-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.buffer.UnpooledByteBufAllocator$InstrumentedUnpooledUnsafeNoCleanerDirectByteBuf.<init>(UnpooledByteBufAllocator.java:181)
 ~[io.netty-netty-buffer-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.buffer.UnpooledByteBufAllocator.newDirectBuffer(UnpooledByteBufAllocator.java:91)
 ~[io.netty-netty-buffer-4.1.77.Final.jar:4.1.77.Final]
        at 
io.netty.buffer.AbstractByteBufAllocator.directBuffer(AbstractByteBufAllocator.java:188)
 ~[io.netty-netty-buffer-4.1.77.Final.jar:4.1.77.Final]
        at io.netty.buffer.Unpooled.directBuffer(Unpooled.java:148) 
~[io.netty-netty-buffer-4.1.77.Final.jar:4.1.77.Final]
        at 
org.apache.bookkeeper.bookie.storage.ldb.ReadCache.<init>(ReadCache.java:79) 
~[org.apache.bookkeeper-bookkeeper-server-4.15.1.jar:4.15.1]
        at 
org.apache.bookkeeper.bookie.storage.ldb.ReadCache.<init>(ReadCache.java:67) 
~[org.apache.bookkeeper-bookkeeper-server-4.15.1.jar:4.15.1]
        at 
org.apache.bookkeeper.bookie.storage.ldb.SingleDirectoryDbLedgerStorage.<init>(SingleDirectoryDbLedgerStorage.java:174)
 ~[org.apache.bookkeeper-bookkeeper-server-4.15.1.jar:4.15.1]
        at 
org.apache.bookkeeper.bookie.storage.ldb.DbLedgerStorage.newSingleDirectoryDbLedgerStorage(DbLedgerStorage.java:196)
 ~[org.apache.bookkeeper-bookkeeper-server-4.15.1.jar:4.15.1]
        at 
org.apache.bookkeeper.bookie.storage.ldb.DbLedgerStorage.initialize(DbLedgerStorage.java:156)
 ~[org.apache.bookkeeper-bookkeeper-server-4.15.1.jar:4.15.1]
        at 
org.apache.bookkeeper.bookie.BookieResources.createLedgerStorage(BookieResources.java:110)
 ~[org.apache.bookkeeper-bookkeeper-server-4.15.1.jar:4.15.1]
        at org.apache.bookkeeper.server.Main.buildBookieServer(Main.java:423) 
~[org.apache.bookkeeper-bookkeeper-server-4.15.1.jar:4.15.1]
        at 
org.apache.pulsar.metadata.bookkeeper.BKCluster.startBookie(BKCluster.java:299) 
~[org.apache.pulsar-pulsar-metadata-2.11.0-SNAPSHOT.jar:2.11.0-SNAPSHOT]
        at 
org.apache.pulsar.metadata.bookkeeper.BKCluster.startNewBookie(BKCluster.java:283)
 ~[org.apache.pulsar-pulsar-metadata-2.11.0-SNAPSHOT.jar:2.11.0-SNAPSHOT]
        at 
org.apache.pulsar.metadata.bookkeeper.BKCluster.startBKCluster(BKCluster.java:184)
 ~[org.apache.pulsar-pulsar-metadata-2.11.0-SNAPSHOT.jar:2.11.0-SNAPSHOT]
        at 
org.apache.pulsar.metadata.bookkeeper.BKCluster.<init>(BKCluster.java:137) 
~[org.apache.pulsar-pulsar-metadata-2.11.0-SNAPSHOT.jar:2.11.0-SNAPSHOT]
        at 
org.apache.pulsar.metadata.bookkeeper.BKCluster$BKClusterConf.build(BKCluster.java:114)
 ~[org.apache.pulsar-pulsar-metadata-2.11.0-SNAPSHOT.jar:2.11.0-SNAPSHOT]
        at 
org.apache.pulsar.PulsarStandalone.startBookieWithMetadataStore(PulsarStandalone.java:454)
 ~[org.apache.pulsar-pulsar-broker-2.11.0-SNAPSHOT.jar:2.11.0-SNAPSHOT]
        at org.apache.pulsar.PulsarStandalone.start(PulsarStandalone.java:295) 
~[org.apache.pulsar-pulsar-broker-2.11.0-SNAPSHOT.jar:2.11.0-SNAPSHOT]
        at 
org.apache.pulsar.PulsarStandaloneStarter.main(PulsarStandaloneStarter.java:141)
 ~[org.apache.pulsar-pulsar-broker-2.11.0-SNAPSHOT.jar:2.11.0-SNAPSHOT]
   ```
   
   
   ### Anything else?
   
   Increasing `XX:MaxDirectMemorySize` in `pulsar_env.sh` can't resolve this 
bug. Seems it's a bug about cache allocator.
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to