java client out of memory

Andy Gross andy at basho.com
Wed Nov 3 16:12:38 EDT 2010


Hi Andrea -

It looks like you're trying to connect to the HTTP port with the protobufs
client.   When I replace port 8098 with 8087 in this sample code, it works
fine.

Hope that helps,

Andy

On Wed, Nov 3, 2010 at 12:50 PM, Andrea Campolonghi
<acampolonghi at gmail.com>wrote:

> Hi,
>
> I am trying to use the riak-java-pb-client.
> Sample very very basic code
>
> public static void main(String[] args) {
>  try{
> RiakClient rc = new RiakClient("localhost",8098);
>  String bucket = "bucket";
> String key = "key";
>  String val = "test";
> RiakObject ro = new RiakObject(bucket,key,val);
>  rc.store(ro);
>
> RiakObject[] ros = rc.fetch(bucket, key);
>  for(RiakObject r : ros){
> System.out.println(r.toString());
>  }
>
> }catch(IOException e){
>  e.printStackTrace();
> }
>
>
> Running this simple test code form eclipse rerquire at least 1.5 GB ram.
> Lower than this I get an out of memory exception.
>
> While If I run the code with that huge memory I get this error:
>
> java.io.EOFException
>
> at java.io.DataInputStream.readFully(DataInputStream.java:180)
>
> at java.io.DataInputStream.readFully(DataInputStream.java:152)
>
> at com.trifork.riak.RiakConnection.receive(RiakConnection.java:89)
>
> at com.trifork.riak.RiakClient.store(RiakClient.java:384)
>
> at com.trifork.riak.RiakClient.store(RiakClient.java:363)
>
> at Runner.main(Runner.java:22)
>
>
>
> Any suggestion???
>
>
> Andrea
>
>
>
> --
> Andrea Campolonghi
>
> Cell : +39 347 2298435
> andrea at andreacfm.com
> http://www.andreacfm.com
>
> Railo Team
> andrea at getrailo.org
> http://getrailo.org
>
>
>
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20101103/2eff1a68/attachment.html>


More information about the riak-users mailing list