Re: Performance Issue / transactions
Leo Mekenkamp <[email protected]>
| Newsgroups | gmane.comp.java.ozone.user |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 2004-05-05 at 23:01, Kurt Marasco wrote: > Below is a small test application, QkbApp.java, that is the beginnings > of a questionnaire system. Also included are two Ozone persistent > classes (I did not include the interfaces), ResponseImpl and > ResponseSetImpl. The newResponse() method has a for loop that > allows multiple responses to be added to a ResponseSet collection. If > the number of new items added here is increased, performance > dramatically decreases. Processor utilization pegs at 100%, but memory > utilization remains low. > > Just for fun, I tried to create a million records. Four days later I > killed the process. I had about 2.5 MB written to disk at that point. > This has to be the result of some simple stupid mistake on my part. > Please help to point out my error that is resulting in this > performance issue. It is not such much of an error, as well as a direct result of _where_ you are creating new database objects. > Also, when I killed the million record process, many responses were > persisted to disk. Should the records not have been reversed since the > transaction was never completed? There is no 'the transaction', there have been a lot of transactions. Each iteration implicitly starts a new transaction. To have only 1 transaction (and a hell of a lot better performance) try to create your objects server side, i.e. create something like an ObjectCreatorImpl or something, and put the 'million objects iteration' in one of its methods. Then call that method from a client. Also, please note that a using a java.util.HashMap inside an ozone object is not very scalable; every time an ozone object with such a HashMap is changed, it has to be persisted to disk at least one time for every transaction, which means serializing the whole HashMap... If you use org.ozoneDB.collections.NodeTreeMap from ozoneCollections*.jar, you avoid these scalability issues. There is no HashMap-like ozone counterpart, because of how a hashtable works inside. > BTW, the machine is a 1Ghz Duron, with 1GB ram. I'm mostly developing on a 1.3GHz Thunderbird with 1GB, so no problems there. Cheers, Leo ------------------------------------------------------- This SF.Net email is sponsored by Sleepycat Software Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher performing products faster, at low TCO. http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3