You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Sizhong Liu <to...@gmail.com> on 2010/05/03 10:18:50 UTC

Why derby will be slow down?

Dear,

I use derby in my application.  There is no complicated technologies to be
used, only 2- or 3-tiers architecture: derby+ibatis+J2EE/Java application.
The Java application will run periodically some piece code every time. The
time costs for that about several hours.
Yes, there are over millions data in one table and computing in Java
application is also intensive.
What problem I have is, the application can run for the first time, but for
the second time, it can not been completed because that derby will be very
slow.
I try to configure "xms512m xmx1024m" memory to start derby. It give the
help but can still not solve the problem.
I guess it is related to the memory/page cash of derby. Maybe derby has not
released the enough memory for new search?
I want to only make clear what is the root cause of it and then we can make
further decision.  Is it possible to select the data for a very long time
because of the derby nature? Or it is sure that the bottleneck can be
avoided?


Sleven

Re: Why derby will be slow down?

Posted by Bryan Pendleton <bp...@gmail.com>.
> What problem I have is, the application can run for the first time, but
> for the second time, it can not been completed because that derby will
> be very slow.

Do you completely exit and re-start the application between these two runs?

If not, then perhaps the application is not entirely freeing all of its
resources after the first run, and so for the second run there are fewer
resources available and hence it is much slower.

You can use a tool like VisualVM to observe the overall behavior of
your application during the runs, and perhaps that will help you better
characterize the behavior in terms of overall properties such as:
  - memory profile (available and used memory)
  - threading
  - disk usage
  - CPU usage

Can you describe the overall operation which you are trying to time? Is it
just a single SQL statement? Or is it a collection of operations?

Can you share any of the code that is being run?

thanks,

bryan