Scala Concurrency slowing down -


I am doing to present with the fact that I am a relative java / ska newbie so i do not deny That something is clear which I am not doing.

I have got a Scala application that connects a MySQL database through Hibernate. This application is designed to process a large amount of data about 2,750,000 records, so I have tried to customize it as much as possible.

It's running on my workstation, which is a QuadCore Intel Xeon with 6 GB RAM (at 1033 MHz) and it runs well and quickly for the first 70 records; By the time it completes in 15 minutes, it has grown to 90k, it has been taken about 25 minutes, which is slowing down on some crawls.

I have checked the timer on the hibernate code and the database recovery is about the same as I have tried and tried to force manual garbage collection to do so, but it Not working too.

The code in question looks something like this:

  val recordCount = Repo.recordCount batch size = 100 val batches = (to record 0 according to the batch size) .toList val for batchJobs = {(Batch Start & Lieutenant batches) yield (Future (new recordformer) format format (new repo (sessionFactory.openSession), batch start, batch size}} All (100000, batchjobs: * _ )  

Inside the recordformer (which is not actually the name if you wondered on your naming plan madness ), It is another query to query for one of the next 100 records and then to pull back the actual record (between between start and end values), they are written in a text file as CSV Looking at the timer output, 5 seconds to pull back the record about each operation within the record operator and then output 0.1 file for one second.

This session is silent at regular intervals and is finally closing it. Run each recordAformer (each recordformer has its own session)

I'm mostly looking for any known bulk containing scala and futures. I have noticed that when it is slowing down, it does not use all eight potential threads which can definitely explain the decline in speed, but it is a mystery to me that why this will suddenly stop and always Around the record mark of 75

Thank you!

EDIT: It is an updated code to show that it uses yield and waits if all makes a difference.

jconsole application, which can be found in JDK ( $ JAVA_HOME / bin / Jconsole ) comes in the bundle with which the application runs it, it is very nice to tell you a few things:

  1. What apps do all your time by doing GC Used to be?
  2. What are the application threads doing?

Can you post the result here?


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -