Bug 995964 - Critical performance issues with deleting large TMs
Critical performance issues with deleting large TMs
Product: Zanata
Classification: Community
Component: Component-Persistence (Show other bugs)
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: Carlos Munoz
Zanata-QA Mailling List
Depends On:
  Show dependency treegraph
Reported: 2013-08-12 01:12 EDT by Damian Jansen
Modified: 2013-11-26 22:31 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-11-26 22:31:35 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Damian Jansen 2013-08-12 01:12:35 EDT
Description of problem:
The test TM is of 250MB. Deleting this after it was installed caused repeated memory exceptions

Version-Release number of selected component (if applicable):

How reproducible:
Moderate, always

Steps to Reproduce:
1. Go to Administration, Translation Memory
2. Install a very large TM - test was of 250MB
3. Press Delete / Clear
4. Press OK

Actual results:
* java.lang.OutOfMemoryError: Java heap space
* java.lang.OutOfMemoryError: GC overhead limit exceeded

Expected results:
Deleted entries.

Additional info:
Comment 1 Damian Jansen 2013-08-12 01:15:16 EDT
This also seems to lock down the server for some indeterminate amount of time, preventing user access.
User is presented with:

JBWEB000309: type JBWEB000066: Exception report

JBWEB000068: message JBWEB000247: Filter execution threw an exception

JBWEB000069: description JBWEB000145: The server encountered an internal error that prevented it from fulfilling this request.

JBWEB000070: exception

javax.servlet.ServletException: JBWEB000247: Filter execution threw an exception
JBWEB000071: root cause

java.lang.NoClassDefFoundError: Could not initialize class org.jboss.seam.mock.MockViewHandler
Comment 2 Carlos Munoz 2013-08-12 21:18:06 EDT
Made TM delete asynchronous. 
In order to delete a TM, the process is now two-step: 
1. Clear the TM
2. Delete the TM

Comment 3 Damian Jansen 2013-08-15 01:51:28 EDT
Line 108 of TransMemoryDAO.java uses setFetchSize (rather than setMaxResults) which is a hint and is ignored by the sql driver (unless some hackery with autocommit is imposed).
The result of this is the batch size is the entire TM.

Replacing this line with .setMaxResults(batchSize) works.
Comment 4 Damian Jansen 2013-08-15 01:53:58 EDT
Also, the end result of this size batch is a database timeout while the query is generated.
Comment 5 Carlos Munoz 2013-08-15 01:54:22 EDT
Fix issue with the clearing of large TMs.

Reduce the batch size to a smaller size.
Use the correct method when setting up TU batches to clear.

Comment 6 Damian Jansen 2013-08-28 00:32:10 EDT
Verified at 6cffb1ba3ce14c4c5803c1e40556bd8d58a60363
Comment 7 Sean Flanigan 2013-11-26 22:31:35 EST
Closing VERIFIED bugs which predate Zanata 3.1.2.

Note You need to log in before you can comment on or make changes to this bug.