Results 1 to 6 of 6

Thread: Serious performances issues

  1. #1

    Default Serious performances issues

    Hi,

    I have an Spring application running in 7 different instances, all instances running in the same (AIX) server.

    These 7 instances are running dramatically slow, I wonder if there is a descrition of the minimum amount of memory needed by the JVM in order to launch Spring.

    Also, if by chance there's a troubleshooting guide in order to detect these performanmce issues please let me know.

    Thanks a lot.

  2. #2
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    I do not know about exact numbers, but Spring itself should not occupy that much memory. However, if your configuration contains large number of beans and/ or beans with big memory footprint then you will encounter problems. But that is then a responsibility of your application itself.

    I recommend using a memory profiler to find out more details about where the observed memory consumption actually comes from.

    Regards,
    Andreas

  3. #3

    Default

    This is a funny fact:

    -In DEV the applications works properly, with good speed.

    -In STAGE, the JVM takes 80% of the CPU.

    Any suggestion is welcome. Thanks.

  4. #4

    Default

    Now we see wher the problem is, it is an XML validation method with Xerces2:


    private boolean validateXmlVsSchema(String SchemaUrl, String xmlString) throws ValidationException, SAXParseException, UnhandleableException {

    File schema = new File(SchemaUrl);
    log.debug("The schema is being searched at: " + SchemaUrl);
    if ( !schema.exists() ) {
    throw new UnhandleableException(ValidatorConstants.SCHEMA_NO T_FOUND_EXCEPTION,
    new Exception(ValidatorConstants.SCHEMA_NOT_FOUND_EXCE PTION));
    }

    SAXParser parser = new SAXParser();
    try{
    parser.setFeature("http://xml.org/sax/features/validation", true);
    parser.setFeature("http://apache.org/xml/features/validation/schema", true);
    parser.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
    parser.setProperty("http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation", SchemaUrl );
    Validator handler = new Validator();
    parser.setErrorHandler(handler);
    InputStream is = new ByteArrayInputStream( xmlString.getBytes("UTF-8"));
    parser.parse(new InputSource(is));
    if(handler.validationError==true){
    log.error(clazzName + "-> " + ValidatorConstants.SCHEMA_VALIDATION_ERROR + ": " + handler.validationError +
    "" + handler.saxParseException.getMessage(), handler.saxParseException);
    throw handler.saxParseException;
    } else {
    log.debug(clazzName + "-> " + ValidatorConstants.DOCUMENT_VALIDATED );
    return true;
    }
    } catch( java.io.UTFDataFormatException utfex){
    log.info(clazzName + "-> Wrong utf: " + utfex.getMessage(), utfex );
    } catch(java.io.IOException ioe){
    log.error(clazzName + "-> IOException " + ioe.getMessage(), ioe);
    throw new ValidationException(ValidatorConstants.SCHEMA_VALI DATION_EXCEPTION, ioe);
    } catch (SAXParseException e) {
    log.error(clazzName + "-> SAXParseException " + e.getMessage(), e);
    throw e;
    } catch (SAXNotRecognizedException e) {
    log.error(clazzName + "-> SAXNotRecognizedException " + e.getMessage(), e);
    throw new ValidationException(ValidatorConstants.SCHEMA_VALI DATION_EXCEPTION, e);
    } catch (SAXNotSupportedException e) {
    log.error(clazzName + "-> SAXNotSupportedException " + e.getMessage(), e);
    throw new ValidationException(ValidatorConstants.SCHEMA_VALI DATION_EXCEPTION, e);
    } catch (SAXException e) {
    log.error(clazzName + "-> SAXException " + e.getMessage(), e);
    throw new ValidationException(ValidatorConstants.SCHEMA_VALI DATION_EXCEPTION, e);
    }
    return true;
    }



    I have granted all permissions to the application in order to read the XML schema in the file system, but for some reason it slows down too much.

    Thanks for your help!

  5. #5
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    Indeed strange. I would use a profiler to check what is going on there.

  6. #6
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    If you could not determine the cause (by profiling) then at last resort you could try disabling the XML validation.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •