Question

I was trying to connect to voltdb via JDBC API, but always get OutOfMemoryError. I know, i can get rid of it by increasing heap size, but i want to know, why it require large heap size? I already have 1028M set as Heap size.

Exception in thread "http-bio-8080-exec-206" java.lang.OutOfMemoryError: Java heap space
        at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:39)
        at java.nio.ByteBuffer.allocate(ByteBuffer.java:312)
        at org.voltdb.client.ConnectionUtil.getAuthenticatedConnection(ConnectionUtil.java:213)
        at org.voltdb.client.ConnectionUtil.getAuthenticatedConnection(ConnectionUtil.java:143)
        at org.voltdb.client.ConnectionUtil.getAuthenticatedConnection(ConnectionUtil.java:118)
        at org.voltdb.client.Distributer.createConnectionWithHashedCredentials(Distributer.java:614)
        at org.voltdb.client.ClientImpl.createConnectionWithHashedCredentials(ClientImpl.java:171)
        at org.voltdb.client.ClientImpl.createConnection(ClientImpl.java:542)
        at org.voltdb.jdbc.JDBC4ClientConnection.<init>(JDBC4ClientConnection.java:141)
        at org.voltdb.jdbc.JDBC4ClientConnectionPool.get(JDBC4ClientConnectionPool.java:83)
        at org.voltdb.jdbc.Driver.connect(Driver.java:91)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:207)

Deployment.xml

<?xml version="1.0"?>
<deployment>
    <cluster hostcount="1" sitesperhost="2" kfactor="0" />
    <httpd enabled="true" port="65534">
        <jsonapi enabled="true" />
    </httpd>
</deployment>
Was it helpful?

Solution

It looks like you're trying to connect to the wrong port on the server. The HTTP port is used for JSON procedure execution and for some monitoring and management. You should connect the client to the VoltDB client port, which is port 21212 by default.

The ports used by VoltDB and how to override them are documented in the Management Guide, Appendix A.5.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top