Question
· Jul 18, 2017

how to release memory for process?

hi

  I query large mount of rows from one table with JDBC, and will prompt <store> error.  I found that it was out of process memory (default 16M, max 49M in version 2010.2) .

  so my question is : how to release memory for large  mount of rows  query? or how to resolve this error?

Discussion (24)2
Log in or sign up to continue

There is a method $system.Memory.Clean(<cleancache>, <defragment>), but unfortunately it appeared only with version 2011.1.

Try this code (consider that LONGVARCHAR = %Stream.GlobalCharacter) Read a CLOB through JDBC:

try
{
  ByteArrayOutputStream bos = new ByteArrayOutputStream();
  Statement st = dbconn.createStatement();
  ResultSet rs = st.executeQuery("Select ID,Text from eprinstance.isegment");
 
  while (rs.next())
  {
    int len;
    Reader reader = rs.getCharacterStream("Text");
    while ((len = reader.read()) != -1)
      bos.write(len);
 
    System.out.println(bos);
 
    reader.close();
    bos.reset();
  }
 
  bos.close();
  st.close();
  rs.close();
 
  System.out.println("OK!");
} finally
{
  dbconn.close();
}

There are a couple of versions that use process private memory for GROUP BY but I don't think Cache 2010.2 is one of them, I was questioning myself as I was typing my first entry.

Looking at your post again you don't say what value you have for process memory.  When working with SQL we strongly recommend that you change this to the max value, 49M.

 

I still would like to see the full error message.

 

Brendan