The following situations and their solutions may be helpful if you notice increased memory use in jConnect applications.
In jConnect applications, you should explicitly close all Statement objects and subclasses (for example, PreparedStatement, CallableStatement) after their last use to prevent statements from accumulating in memory. Closing only the ResultSet is not sufficient.
For example, the following statement causes problems:
ResultSet rs = _conn.prepareCall(_query).execute();
... rs.close();
Instead, use the following:
PreparedStatement ps = _conn.prepareCall(_query); ResultSet rs = ps.execute();
... ps.close(); rs.close();
jConnect uses TDS—the Sybase proprietary protocol—to communicate with Sybase database servers. As of jConnect 6.0, TDS does not support scrollable cursors. To support scrollable cursors, jConnect caches the row data on demand, on the client, on each call to ResultSet.next. However, when the end of the result set is reached, the entire result set is stored in client memory. Because this may cause a performance strain, Sybase recommends that you use TYPE_SCROLL_INSENSITIVE result sets only when the result set is reasonably small.