@@ -0,0 +1,1723 @@
+/*%0A*  Copyright (c) $%7Bdate%7D, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.%0A*%0A*  WSO2 Inc. licenses this file to you under the Apache License,%0A*  Version 2.0 (the %22License%22); you may not use this file except%0A*  in compliance with the License.%0A*  You may obtain a copy of the License at%0A*%0A*    http://www.apache.org/licenses/LICENSE-2.0%0A*%0A* Unless required by applicable law or agreed to in writing,%0A* software distributed under the License is distributed on an%0A* %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A* KIND, either express or implied.  See the License for the%0A* specific language governing permissions and limitations%0A* under the License.%0A*/%0A%0Apublic class Executor %7B%0A%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        System.out.println(%22GenerateOOM started......%22);%0A        Thread.sleep(5000);%0A        generateOOM(1.1,10000);%0A    %7D%0A%0A%0A    /**%0A     * This method generate Out of memory exception eventually%0A     *%0A     * Generate int arrays with growing length%0A     *%0A     * @param multiplier%0A     * @param addition%0A     * @throws Exception%0A     */%0A    static void generateOOM(double multiplier , int addition) throws Exception %7B%0A%0A        int iteratorValue = 10;%0A%0A        for (int outerIterator = 1; outerIterator %3C 20000; outerIterator++) %7B%0A%0A            int loop1 = 2;%0A            int%5B%5D memoryFillIntVar = new int%5BiteratorValue%5D;%0A%0A            // feel memoryFillIntVar array in loop..%0A            do %7B%0A                memoryFillIntVar%5Bloop1%5D = 0;%0A                loop1--;%0A            %7D while (loop1 %3E 0);%0A%0A            //increase the length of next array%0A            iteratorValue = (int)(iteratorValue * multiplier) + addition;%0A%0A            Thread.sleep(500);%0A        %7D%0A    %7D%0A%0A%0A%7D%0A

add new sample app - GenerateOOM