What would cause this, and how can I adjust ? Using SQL Anywhere 16, dbsrv16 64 Bit, Java 8 64 Bit, on Windows 7 with 8G Memory. No other applications are running The error occurs running a Stored Procedure, that has a Dynamic Scroll Cursor looping thru 1.8 Million Records It has worked previously with up to 360,000 Records Any advice appreciated Greg asked 11 Jun '17, 16:31 Gregory Durniak |
Thanks for all your quick responses !
Since it can't be the database, I checked the 360Works JDBC Plugin on the "client" side. It does have an ini to increase the Java Heap. That appears to have fixed it. answered 12 Jun '17, 07:47 Gregory Durniak Breck Carter |
JAVA uses JNI for shared lib access, obviously in guindows its some different in memory management.. but the principle was to work in any UNIX or other OS due performance and stability.. The new behaviour in Sybase from version 12 was multiplatform.. no so much impact in the bussines.. the JNI implementation permits access to OS specific properties using shared lib objects files due JAVA are very very slower and unoptimized in performance.. JNI its a java implementation to combine other programin access languaje like C with interacting to JAVA languaje answered 15 Jun '17, 09:33 mckaygerhard 1
Please don't confuse the users with useless answers. Without the proof I disagree with what you have said:
(18 Jul '17, 07:27)
Vlad
|
Oh! I know, I know! Oops, sorry – to find who is consuming the heap, please tell JVM to create the dump after OOM:
http://www.oracle.com/technetwork/java/javase/clopts-139448.html#gbzrr
You should analyze it with "mat" to see the heaviest objects in the heap. You can give us your heap as well, but pay attention that one can read your private stuff.
Without the heap dump, I won't help much since I don't know what your code is doing.
So what application is running besides the database server, and what is it doing? Or does the database server make use of external stored procedures written in Java?
The Stored Procedure is run with a Query from FileMaker Pro ( on another machine ), using a JDBC Plugin. The Stored Procedure is in SQL Anywhere.
Just curious: if dbsrv16 is an exe application, what does Java do ?
> what does Java do ?
The default answer is "nothing". Two possibilities come to mind: First, the stored procedure is written in Java... but since you know that the stored procedure contains "a Dynamic Scroll Cursor", presumably you would also know if the procedure is written in Java.
Second, the client is running Java; for example, the CALL statement is run in a dbisql window, and it is dbisql (a Java client application) which is failing, not the server.
It is up to you to determine where the Java code is.
The CALL Statement is sent thru JDBC from a Client machine. Does that open dbisql on the Server Machine ? How can I adjust the default Heap Size ? The procedure was written using Watcom-SQL in Sybase Central
Hm, I still get the data flow between the client machine using JDBC to call a Watcom-SQL stored procedure within the database server and the "Query from FileMaker Pro ( on another machine ), using a JDBC Plugin" - is FileMaker Pro that client, or is the database server accessing another data source within the stored procedure?
As to your last statement: No, a JDBC client application does not open a DBISQL session on the server machine.
And just to assure: Where does the error message appear - on the client or in the database server's machine?
FileMaker just sends a query thru JDBC, to run the Procedure. It does not get, or need a response, so I do not believe the problem is on the "client" side
Again, if DBISQL does not open, what does JAVA do ?
So what is the result of the stored procedure (SP)? If it returns a result set (say, via one or more final SELECT statements within its body), it will supply a result set, and it's up to the client (the FileMaker Pro app in your case, in my understanding) to consume that. Stored procedures are not called in a "fire-and-forget" mode, the server expects the client to consume the result...
Here's a FAQ dealing with the way SQL Anywhere handles SP result sets (compared to other DBMS's), see Mark's response.
In contrast, if the SP just does heavy calculations within the database (by scrolling through large result sets) and just returns some return value (or fill some inout/out parameters), like number of "appropriate rows" or a calculation result or the like, and if it does not itself use Java (i.e. it does not call any external stored procedure/function written in Java), I would not know why it should generate a Java error.
The Stored procedure scolls thru a View ( a UNION of two tables ), does calculations within the database, and sets various values. No value, or result set is returned. Not sure why it would "break", just because there are more records.
So does the error also appear when you call the SP from another client? (Say via the C-based dbisqlc utility that does not use Java at all...)
I still have no clue why you get a Java Heap error at all.
Hm, it seems that you have ignored my suggestion. Instead of guessing and blindly reviewing existing or 3rd party code, the heap dump would answer all your questions.
Believe me, regardless my rating I know what I am talking about :-/