You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by an...@apache.org on 2012/10/05 00:33:07 UTC
svn commit: r1394302 -
/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/transaction/TransactionManager.java
Author: andy
Date: Thu Oct 4 22:33:07 2012
New Revision: 1394302
URL: http://svn.apache.org/viewvc?rev=1394302&view=rev
Log:
Remove batch optimization for 32-bit systems - too memory limited to risk it.
Modified:
jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/transaction/TransactionManager.java
Modified: jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/transaction/TransactionManager.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/transaction/TransactionManager.java?rev=1394302&r1=1394301&r2=1394302&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/transaction/TransactionManager.java (original)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/transaction/TransactionManager.java Thu Oct 4 22:33:07 2012
@@ -63,7 +63,17 @@ public class TransactionManager
* deciding to flush the journal to the main database.
*/
// Temporarily public ....
- public static /*final*/ int QueueBatchSize = 10 ;
+ public static /*final*/ int QueueBatchSize = setQueueBatchSize() ;
+
+ private static int setQueueBatchSize()
+ {
+ if ( SystemTDB.is64bitSystem )
+ return 10 ;
+ // On 32bit systems are memory constrained. The Java address space is
+ // limited to about 1.5G - the heap can not be bigger.
+ // So we don't do batching (change if batching is less memory hungry).
+ return 0 ;
+ }
enum TxnPoint { BEGIN, COMMIT, ABORT, CLOSE, QUEUE, UNQUEUE }
private List<Pair<Transaction, TxnPoint>> transactionStateTransition ;
@@ -75,8 +85,7 @@ public class TransactionManager
transactionStateTransition.add(new Pair<Transaction, TxnPoint>(txn, state)) ;
}
- // Transactions that have commited (and the journal is written) but haven't
- // writted back to the main database.
+ // Statcis variable to record the maximum length of the flushe queue.
int maxQueue = 0 ;
List<Transaction> commitedAwaitingFlush = new ArrayList<Transaction>() ;