Version 7

    Adding or Editing a HTML page with the HTMLModule causes extra linefeeds

     

    Problem

     

    When using the HTMLModule's form to create or edit HTML pages the content appears to have a blank line added on every other line. Viewing most HTML doesn't display the problem because of how browsers render HTML except in PRE tags. The form shows the extra lines when you edit the page.

     

    Solution

     

    The problem only manifests itself when you copy & paste from certain text editors. Try using a different text editor or type in the content yourself.

     

     

    Submitting a form with a file depletes memory

     

    Problem

     

    Any Nukes form with a file field uses a lot of memory when submitted. (For example the HTML Module is doing that)

    The problem is in the Apache library used commons-fileupload.jar, there is too much allocated memory for every field of the form.

     

    Solution

     

    In DeferredFileOutputStream there is this method:

     public DeferredFileOutputStream(int threshold, File outputFile) 
     { 
     super(threshold); 
     this.outputFile = outputFile; 
     
     memoryOutputStream = new ByteArrayOutputStream(threshold); 
     currentOutputStream = memoryOutputStream; 
     }
    

     

    I replaced it with:

     public DeferredFileOutputStream(int threshold, File outputFile) 
     { 
     super(threshold); 
     this.outputFile = outputFile; 
     
     memoryOutputStream = new ByteArrayOutputStream(); 
     currentOutputStream = memoryOutputStream; 
     }
    

    So i am not allocating threshold bytes for any field, instead only 32Bytes are allocated at first and grows up as needed.

     

    You can replace your existing library in $NUKES_HOME/thirdparty/apache-commons/lib by the one with the small change that you can get attached to this page.

     

    -