1

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>
RickDavis
  • 2,276
  • 6
  • 25
  • 31
  • Hi, I work for VoltDB. We're not aware of any issues with heap space using the JDBC driver, so we'd like your help with some additional background to diagnose the issue you're getting. 1) how much heap does the calling code use? 2) how many nodes(servers) are you connecting to? 3) How many instances of the JDBC driver are you using? – BenjaminBallard Nov 25 '13 at 14:35
  • 4) What port are you connecting to? We have a theory this may be the result of connecting to the http port. – BenjaminBallard Nov 25 '13 at 15:04
  • Thanks Ben, I wrote simple client as per your docs. I am using 8083 port, which is configured as voltdb port. I am connecting to one server only. Is that issue? I will give you other details soon. – RickDavis Nov 26 '13 at 17:48
  • I changed to port 65534, but still it gave me OutOfMemoryError. I am simply trying to run voter example, see my deployment.xml in main post Edit. – RickDavis Nov 27 '13 at 13:02
  • Hi Rick, thanks for following up. My colleague, Izzy, responded below. I think he's right. The default port number for database connections is 21212, and the port you specified in the deployment.xml file is for the HTTP/JSON interface. – BenjaminBallard Dec 02 '13 at 16:06
  • Thanks Ben and Izzy, it worked. – RickDavis Dec 03 '13 at 10:04

1 Answers1

1

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.

BenjaminBallard
  • 1,482
  • 12
  • 11
izzy
  • 26
  • 1