Out of Memory Error in Java Agents running in lotus notes

I have a java agent running inside lotus notes jvm. It runs fine for some days but after some days start giving out of memory error and terminates.
I need to restart agent manager in notes to enable java agent running. Is there a way to catch out of memory error so that on its catch i could restart agent manager.
Regards,
Saitu

Dear Peter,
The agent is written in java and
I need to know a way to enter catch block of 'OUTOFMEMORYERROR'.
My whole code is in a try block with two catches, one for outofmemoryerror and another for exception. When outofmemory error occurs control passes to the exception catch and not outofmemoryerror catch.
Since out of memory is an error and not an exception, is there a way to catch it or run some code when out of memory occurs.
Regards,
Saitu

Similar Messages

  • Out of memory error in java- flex communication using RTMP

    We are using flex and java in our application. due to RTMP call to fetch data every 5 seconds. it is hiting database and establishing connection and keeps it open hence this is causing for Out of memory issue. Can come one help on this issue.

    You probably want to ask here: http://forums.adobe.com/community/flex

  • Out of memory error, Urgent!!!

    Hi All,
    I know there have been a lot of posts for this topic, but none of them seem to address my problem. So please help me out!!! I have written an GUI application that if you open and close for up to certain times, say 10 times, then you will get OOM. I have set the objects to be null when closing the application and called System.gc() as well as System.runFinalization(). Note that I can't call System.exit(0) since this application is not a standalone one. I thought in java if the objects are not used any more, then they will be garbage collected. I may not even have to set the objects to be null. But obviously there are still references to these objects in memory.
    I am really frastrated. I read about SoftReference, but I don't get the error while running the application. So I don't think it's very useful for my case.
    hhh

    >
    You probably still have references to the objects
    somewhere.
    The variables you've set to null, aren't the only
    references.
    Is there a way that I can find out what referencesare
    still alive after I exit the application?
    After you exit the application? After you exit
    the application, there are zero references, and also
    it's impossible to get out of memory errors from java
    after it exits.
    But I think you may be using the word "application" or
    "exit" incorrectly here...
    What do you mean you don't get the error whenrunning
    the application?I meant I don't get OOM error while running
    application. I simply launch the application andthen
    exit it. By doing so for about 10 times, then I get
    the OOM error. But that's impossible. After the JVM exits, the JVM
    can't throw an out of memory error. It can't throw
    any errors. It's not running anymore.As I said in my original message, my application is not a standalone one. It is actually one of the tools out of the main application. That's why when I exit this tool I can't use System.exit(0) to stop JVM.

  • JavaScript Out of Memory Error on Portal timeout.

    Hello All,
    I am using jsf and Inline navigation in all our portlets and when user leave the browser idle for portal timeout we have 2 problems. 1: Login portlet shows in that specific portlet. 2: we get a javascript alert saying out of memory at line 40. and the porltet shows error message as "Gateway was not able to access requested content. If the error persists, contact your portal Administrator."
    We are using Plumtree 5.0.4 Java version.
    any help is highly appreciated.
    Thanks
    A.J.

    Both are valid behaviors unfortunately.
    1) login portlet is showing up in specific portlet b/c inline navigation allows for you to create and load pages without affecting the overall portal.
    This happens when you use iframes (which behave in a similar fashion).
    - your only workaround is really to write some javascript function to "listen" to the portal login page getting loaded and then throwing the session into the parent browser (which is Portal). At least this is the only solution that I ever came up with when using Iframes.
    2) Don't know about out of memory error actually, but getting the "gatewy was not able to access requested content" is valid b/c the session died.
    - javascript errors require javascript solutions. Sorry I couldn't be more helpful than that.
    Maybe someone else will have better suggestions.
    The other suggestion is to use your app server to listen to the logout event and redirect appropriately to somewhere else, or have it do what you want it to do in situations as this.

  • Weblogic generating out of memory error when commandline run doesn't

    Hello,
    I am just beginning to use weblogic. I have a jar file which runs fine if run from command line with the options
    "C:\Program Files (x86)\Java\jre6\bin\java" -jar -Xms1024m -Xmx1024m Report.jarIt connects to oracle and selects some data around (500k records) and writes it to a csv.
    When I run the same jar from within a web application (I mean obvoiusly a servlet calling the jar's main method) the webapp generates
    out of memory error after 80k records itself.
    I tried changing the configuration the server Startup arguments from the console (Server Start and then Arguments) and then restart.
    I just wrote the same thing there -Xms1024m -Xmx1024m
    I guess I am missing something. Please share your answers.
    Environment :
    Win2k8, weblogic 10gR3, jdk 1.5. The application is installed as a service.
    Thanks,
    Neetesh
    Edited by: user13312817 on 5 Dec, 2011 12:15 AM

    If you are not using NodeManager, then I don't think those server settings actually control anything. If you are just exploring WLS, then I suspect you are simply starting an AdminServer in a basic domain and don't have a cluster/nodemanager based environment. I could be wrong, please correct as needed!
    If you are simply starting your WebLogic Server instance using the startWebLogic.sh|cnd script, you can set an environment variable on the command shell that will be picked up and used when the server starts.
    set USER_MEM_ARGS=-Xmx1024 -Xms1024m
    * apply appropriate *nix changes as appropriate.
    Then use the startWebLogic.sh|cmd script to start the server and test your application.
    It may very well be the case that your particular application consumes > 1GB heap so you may need more. Remember that you now have a server environment running over your "main" class, so there is bound to be more memory used that could be just sneaking your heap use over 1GB. For example.
    -steve-

  • Java.lag out of memory error

    my x2 cannot work with the pdf reader i downloaded from nokia store as there is java.lag out of memory error what should i do

    it is common in most s40 phones.....even my C3 does thesame

  • Why do I get a Track out of memory error while running open loop frequency response?

    MatrixX Build 61mx1411: I get a "Track out of memory" error when I run the Open Loop Frequency Response from the MatrixX pull down tools. What can I do to prevent this? We are running on an HP B1000 with 768 MB of RAM under HP-UX 10.2.

    In the old days of Mx say Version 5 and prior the user actually selected the amount of memory that would be allocated. Depending on the size of the model etc. you would have to allocate memory. In version 6.0 and going forward there is no need for the user to manually allocate the memory.
    Build {rstack=50000,istack=200000,sstack=50000,cstack=50​0 000}
    If this is a command in a script file that you are running and the error is resulting from that then I would try commenting out everything after the letter d in the word build and then starting it back up.
    i.e. only use Build
    I don't believe that there is a way to manually allocate the initial SystemBuild Stack size.
    I believe initially the stack size is set to 10010.
    However, one way
    you can manually set the initial SystemBuild stack size,is to create a large StateSpace as soon as you start up SystemBuild. This will prevent piece-meal reallocs while using SystemBuild.
    You can created a new SuperBlock in SystemBuild and then drop down a StateSpace Block with 199 inputs and 199 Outputs and 1 State and entered ones(200,200)as the StateSpace Matrix without any problems. This would resize this internal stack to at least 40000.
    You really should not have to do this but if that helps then you might think about doing this in your startup.ms file you could use SBA or load the file then you could delete the superblock and begin working.
    "Bob" gave me this little tid bit.
    Please let me know if any of this is of use.
    Garrett
    Garrett Thurston
    [email protected]
    Phone: 781.993.5540

  • CS6 Running out of memory Error while rendering

    Hey everyone,
    I recently upgraded to After Effects CS6 thinking it would be a great investment. So far, I have been horribly wrong!
    Here's my computer's specs: (this is a huge upgrade from the computer I was running 5.5 on without any problems other than it being slow)
    Intel i7-3615QM 2.3GHz Ivy Bridge processor
    8GB GDDR5 RAM
    NVIDIA GeForcs 650M w/ 2GB GDDR5 dedicated RAM
    Here's what's happening:
    I've been doing recording for my job at 1080p in front of a green screen. I record 16 minute sections. I use Keylight to replace the background with a still picture, and then export the video at half resolution, with audio as H.264 (.mp4) files. Normally I would set up the 16 minute sections to render in queue, but it kept having the "out of memory" error shortly after starting the one second in line. So then I started just doing one at a time... and now it won't even make it through one!
    I have noticed that even after rendering is done, AE is still using 6 gigs of RAM! Usually I can purge the ram, but now even doing that doesn't change anything - I have to close the program to get my RAM back. I have tried enlarging my page file, I've tried rendering in different resolutions and file types - I feel like I've tried everthing. I've looked all over the internet and I haven't found any real solutions (just talk from 2008 about "secret" menus that I can't get to work).
    Please help!!
    Thank you!!
    Dominic

    I wouldn't mind getting more RAM except that the computer I used to do this very same work with (except with 5.5) only had 6GHz of RAM and a pathetic processor and GPU in comparison.
    I've tried doing the same editing in PrP but it just doesn't have enough tools . Changing my output format hasn't helped either unfortunately. I think the program has a memory leak.
    I really think I might just go back to 5.5. I called support today and it took forever just to get the poor girl helping me to understand my name has an "m" in it. She wasn't really able to understand the problem. As far as I can tell, CS6 has been a 100% downgrade.
    Thank you both for the help!
    Dominic

  • Out of Memory Error While deploying as EAR file

    Hai,
    I was trying to deploy an EAR file of size 63 MB which inturn containing about 60 EJB.jars. No WARs. application.xml has all the entries for the JARs. While I am deploying it is giving Out of Memory Error. Is there any way to tweak this problem. I am using my own hand written java application which uses the SunONE deployment APIs for deployment. Can u please tell how to tackle this problem. I am running my application through a batch file which uses jdk1.4.
    Please help me regarding this issue.

    You can set the initial heap size and maximum heap size for the JVM, either in the app-server admin console, or maybe in one of your scripts. You look-up the syntax!...
    I had this error yesterday. I too had run out of memory (150Mb). You simply need to allocate more to the app-server.

  • Uploading large files from applet to servlet throws out of memory error

    I have a java applet that needs to upload files from a client machine
    to a web server using a servlet. the problem i am having is that in
    the current scheme, files larger than 17-20MB throw an out of memory
    error. is there any way we can get around this problem? i will post
    the client and server side code for reference.
    Client Side Code:
    import java.io.*;
    import java.net.*;
    // this class is a client that enables transfer of files from client
    // to server. This client connects to a servlet running on the server
    // and transmits the file.
    public class fileTransferClient
    private static final String FILENAME_HEADER = "fileName";
    private static final String FILELASTMOD_HEADER = "fileLastMod";
    // this method transfers the prescribed file to the server.
    // if the destination directory is "", it transfers the file to
    "d:\\".
    //11-21-02 Changes : This method now has a new parameter that
    references the item
    //that is being transferred in the import list.
    public static String transferFile(String srcFileName, String
    destFileName,
    String destDir, int itemID)
    if (destDir.equals(""))
    destDir = "E:\\FTP\\incoming\\";
    // get the fully qualified filename and the mere filename.
    String fqfn = srcFileName;
    String fname =
    fqfn.substring(fqfn.lastIndexOf(File.separator)+1);
    try
    //importTable importer = jbInit.getImportTable();
    // create the file to be uploaded and a connection to
    servlet.
    File fileToUpload = new File(fqfn);
    long fileSize = fileToUpload.length();
    // get last mod of this file.
    // The last mod is sent to the servlet as a header.
    long lastMod = fileToUpload.lastModified();
    String strLastMod = String.valueOf(lastMod);
    URL serverURL = new URL(webadminApplet.strServletURL);
    URLConnection serverCon = serverURL.openConnection();
    // a bunch of connection setup related things.
    serverCon.setDoInput(true);
    serverCon.setDoOutput(true);
    // Don't use a cached version of URL connection.
    serverCon.setUseCaches (false);
    serverCon.setDefaultUseCaches (false);
    // set headers and their values.
    serverCon.setRequestProperty("Content-Type",
    "application/octet-stream");
    serverCon.setRequestProperty("Content-Length",
    Long.toString(fileToUpload.length()));
    serverCon.setRequestProperty(FILENAME_HEADER, destDir +
    destFileName);
    serverCon.setRequestProperty(FILELASTMOD_HEADER, strLastMod);
    if (webadminApplet.DEBUG) System.out.println("Connection with
    FTP server established");
    // create file stream and write stream to write file data.
    FileInputStream fis = new FileInputStream(fileToUpload);
    OutputStream os = serverCon.getOutputStream();
    try
    // transfer the file in 4K chunks.
    byte[] buffer = new byte[4096];
    long byteCnt = 0;
    //long percent = 0;
    int newPercent = 0;
    int oldPercent = 0;
    while (true)
    int bytes = fis.read(buffer);
    byteCnt += bytes;
    //11-21-02 :
    //If itemID is greater than -1 this is an import file
    transfer
    //otherwise this is a header graphic file transfer.
    if (itemID > -1)
    newPercent = (int) ((double) byteCnt/ (double)
    fileSize * 100.0);
    int diff = newPercent - oldPercent;
    if (newPercent == 0 || diff >= 20)
    oldPercent = newPercent;
    jbInit.getImportTable().displayFileTransferStatus
    (itemID,
    newPercent);
    if (bytes < 0) break;
    os.write(buffer, 0, bytes);
    os.flush();
    if (webadminApplet.DEBUG) System.out.println("No of bytes
    sent: " + byteCnt);
    finally
    // close related streams.
    os.close();
    fis.close();
    if (webadminApplet.DEBUG) System.out.println("File
    Transmission complete");
    // find out what the servlet has got to say in response.
    BufferedReader reader = new BufferedReader(
    new
    InputStreamReader(serverCon.getInputStream()));
    try
    String line;
    while ((line = reader.readLine()) != null)
    if (webadminApplet.DEBUG) System.out.println(line);
    finally
    // close the reader stream from servlet.
    reader.close();
    } // end of the big try block.
    catch (Exception e)
    System.out.println("Exception during file transfer:\n" + e);
    e.printStackTrace();
    return("FTP failed. See Java Console for Errors.");
    } // end of catch block.
    return("File: " + fname + " successfully transferred.");
    } // end of method transferFile().
    } // end of class fileTransferClient
    Server side code:
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.util.*;
    import java.net.*;
    // This servlet class acts as an FTP server to enable transfer of
    files
    // from client side.
    public class FtpServerServlet extends HttpServlet
    String ftpDir = "D:\\pub\\FTP\\";
    private static final String FILENAME_HEADER = "fileName";
    private static final String FILELASTMOD_HEADER = "fileLastMod";
    public void doGet(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException,
    IOException
    doPost(req, resp);
    public void doPost(HttpServletRequest req, HttpServletResponse
    resp)
    throws ServletException,
    IOException
    // ### for now enable overwrite by default.
    boolean overwrite = true;
    // get the fileName for this transmission.
    String fileName = req.getHeader(FILENAME_HEADER);
    // also get the last mod of this file.
    String strLastMod = req.getHeader(FILELASTMOD_HEADER);
    String message = "Filename: " + fileName + " saved
    successfully.";
    int status = HttpServletResponse.SC_OK;
    System.out.println("fileName from client: " + fileName);
    // if filename is not specified, complain.
    if (fileName == null)
    message = "Filename not specified";
    status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
    else
    // open the file stream for the file about to be transferred.
    File uploadedFile = new File(fileName);
    // check if file already exists - and overwrite if necessary.
    if (uploadedFile.exists())
    if (overwrite)
    // delete the file.
    uploadedFile.delete();
    // ensure the directory is writable - and a new file may be
    created.
    if (!uploadedFile.createNewFile())
    message = "Unable to create file on server. FTP failed.";
    status = HttpServletResponse.SC_INTERNAL_SERVER_ERROR;
    else
    // get the necessary streams for file creation.
    FileOutputStream fos = new FileOutputStream(uploadedFile);
    InputStream is = req.getInputStream();
    try
    // create a buffer. 4K!
    byte[] buffer = new byte[4096];
    // read from input stream and write to file stream.
    int byteCnt = 0;
    while (true)
    int bytes = is.read(buffer);
    if (bytes < 0) break;
    byteCnt += bytes;
    // System.out.println(buffer);
    fos.write(buffer, 0, bytes);
    // flush the stream.
    fos.flush();
    } // end of try block.
    finally
    is.close();
    fos.close();
    // set last mod date for this file.
    uploadedFile.setLastModified((new
    Long(strLastMod)).longValue());
    } // end of finally block.
    } // end - the new file may be created on server.
    } // end - we have a valid filename.
    // set response headers.
    resp.setContentType("text/plain");
    resp.setStatus(status);
    if (status != HttpServletResponse.SC_OK)
    getServletContext().log("ERROR: " + message);
    // get output stream.
    PrintWriter out = resp.getWriter();
    out.println(message);
    } // end of doPost().
    } // end of class FtpServerServlet

    OK - the problem you describe is definitely what's giving you grief.
    The workaround is to use a socket connection and send your own request headers, with the content length filled in. You may have to multi-part mime encode the stream on its way out as well (I'm not about that...).
    You can use the following:
    http://porsche.cis.udel.edu:8080/cis479/lectures/slides-04/slide-02.html
    on your server to get a feel for the format that the request headers need to take.
    - Kevin
    I get the out of Memory Error on the client side. I
    was told that this might be a bug in the URLConnection
    class implementation that basically it wont know the
    content length until all the data has been written to
    the output stream, so it uses an in memory buffer to
    store the data which basically causes memory issues..
    do you think there might be a workaround of any kind..
    or maybe a way that the buffer might be flushed after
    a certain size of file has been uploaded.. ?? do you
    have any ideas?

  • Photoshop CS6 has out of memory errors under Mac OS X 10.7.4

    Has anyone who has a 2008 MacBoo Pro with the NVIDIA GeForce 8600M GT 512 MB graphics card tried running Photoshop CS6 under Mac OS X 10.7.4?
    On my MacBook Pro, PS CS6 launches; however, any action results in an out of memory error.  The CS6 versions of After Effects, Premiere Pro and Illustrator all launch and run as expected under 10.7.4.
    If I switch to my Mac OS X 10.6.8 startup volume, Photoshop CS6 runs as expected.
    I have support cases open with Adobe, NVidia and Apple.  Adobe thinks I need to update the display drivers.  NVidia says display drivers must be provided by Apple.  Apple says that the display drivers are current.  The Apple support agent said that he can escalate the case if the issue can be reproduced on more than one computer.
    I'd love to keep my MacBook Pro running another year or so without having to reboot in 10.6.8 every time I need to use Photoshop.  I'd stay with 10.6.8, but of course iCloud requires 10.7.4.
    I have not tried 10.8 yet, but it's on my troubleshooting list.
    Also, PS CS6 runs fine under Mac OS X 10.7.4 on my 2010 iMac.
    Thanks in advance for any feedback.
    - Warren

    It looks like it was indeed the display driver for the NVIDIA GeForce 8600 GT 512 MB graphics card inside my 2008 MacBook Pro.
    It seems that this driver only gets installed if you upgrade from Mac OS X 10.6.7 to 10.7.4 while the startup drive is connected to the MacBook Pro itself.  I had updated while the startup drive was connected to my 2010 iMac. Accordingly, I could have reinstalled Photoshop 100 times without it ever launching as expected.  Having used the external startup drive with three other Apple computers (all 2010 or newer machines) with Photoshop CS6 launching as expected, I had just assumed (mistakenly) that it would work as expected with my 2008 computer.
    So, this was simple enough to resolve by upgrading the OS on the external startup drive while having it connected to the MacBook Pro.   In hindsight, this makes perfect sense.
    -Warren

  • Thread: Out of memory error

    I'm running a program that reads a file of more than 20k lines. Each line of this file is being processed by a thread. Sometimes the program is being halted with the out of memory error.
    What can I do to solve this problem ? Is it better to change the logic of this program and instead of calling a new thread for each line, call few threads to be responsible of processing multiple lines ?
    The current java version is 1.4.2.13. Upgrading it to the most recent version can solve the problem ?
    I'm running it with the following configuration:
    "-Xms1024m -Xmx2048m -XX urvivorRatio=10"
    Thanks a lot,
    Marcos.

    Indeed this design is flawed. It is an old system that came to my hands and now I have to fix some bugs on it.
    What is the difference between calling thousand of threads and having this backport of concurrent to take care of it ? I mean, isn't the jvm responsible for managing the both cases ?
    Using the backport of concurrent and defining a limited size thread pool, what will happen if the number of lines in the file is greater than the size of this pool ?
    Do you have an example or a link to where I can get a good example on how to use it ?
    Thanks for helping!

  • Loading JPEG/Gif images causes Out Of Memory Error

    Hello Java gurus, please shed some light on this.....
    I am not a java newbie, but I am a java newbie in the area of dealing with graphics. I am using JDK 1.4.2_01 on Win XP with 2.4ghz and 512 RAM. When I try to read in a (or a few) JPEG image into a JLabel using ImageIcon, I get an out of memory error everytime. This happens whether I am reading the image out of a jar file or out of a local directory. The JPEG's are 8.5" x 11", and range between 150kb to 900kb. I am trying to load approximately 10 images in a JTabbedPane using new JLabel(ImageIcon) on individual JPanels (one JPanel for each JPEG). Now I get the java.lang.outofmemory error whether I try to load 1 image or 10 images. Anyone got a clue as to what I am doing wrong? I actually do get one image loaded before the error gets thrown. So I do know that it is trying to load the right image. What is going on here? Is it an ImageIcon problem, or are there others who have run into this. It has brought this project to a grinding halt, and I had thought this would be the easier part!!!! Please help me out gurus! Thanks!

    What options/values are you suggesting that I set? Or do you mean something else? Thank you for any ideas that can help me solve this problem. I never had any issues dealing with using ImageIcon for toolbar button graphics (file sizes of 1-3kb), but now with dealing with full page graphics I have run into a brick wall with this out of memory error.

  • Scaling images and Out of memory error

    Hi all,
    Does anyone knows why this code throws an out of memory error?
    It loads an image (2048x1166 pixels) and saves it at bufi1 (BufferedImage). After that:
    1- Rescale bufi1 to bufi13A (x3).
    2. Rescale bufi1 to bufi12 (x2).
    3. Rescale bufi1 to bufi13B (x3).
    At 3, the code throws an oome. Why?
    Thanks in advance!
    import java.io.*;
    import javax.imageio.*;
    import java.awt.geom.*;
    import java.awt.image.*;
    public class TestScalePercent {
      public static void main(String[] args) {
        TestScalePercent tsp=new TestScalePercent();
        BufferedImage bufi1=null;
        try {
          bufi1 = ImageIO.read(new File("foo.png"));//2048x1166 pixels
        } catch (Exception e){
          e.printStackTrace();
        BufferedImage bufi13A=tsp.scale(bufi1,3,3);//--> OK
        BufferedImage bufi12=tsp.scale(bufi1,2,2);//--> OK
        BufferedImage bufi13B=tsp.scale(bufi1,3,3);//-->OOM error!
      public BufferedImage scale(BufferedImage bufiSource, double scaleX, double scaleY){
        AffineTransform tx = new AffineTransform();
        tx.scale(scaleX,scaleY);
        AffineTransformOp op = new AffineTransformOp(tx, AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
        BufferedImage bufiop=op.filter(bufiSource, null);//--> Creates the OOM error...
        return op.filter(bufiop, null);
    }

    How much memory does your machine have?
    That image is quite large. If my math is correct and
    assuming the image has 32-bit color the original
    image takes up 76.5 megs of memory by itself. Then
    you are trying to create three other versions of it.
    It isn't lying to you, it is indeed probably running
    out of memory to hold the images.OK. Now I'm wondering if is it possible to free memory between bufi13A - bufi12, and bufi12 - bufi13B? I've tried to invocate the garbbage collector but nothing happens...
    Thanks!

  • Out of memory Error with jdk 1.6

    Hello,
    I have a swing application launched on the client with the help of Java web start. The applications works fine in jre 1.4 and jre 1.5. The heap sizes are :
    initial-heap-size="5m" max-heap-size="24m"
    But when I run this using jre 1.6.0_05-b13, I am getting Out of memory Error, java heap size. And I see the memory usage is growing rapidly which I didn't notice in other jre versions (1.4 and 1.5).
    Does anyone have any idea on this?
    Thanks in advance,
    MR.

    Thanks for your response Peter. During my continuous testing I identified that error happens on jdk 1.5 also. And I have increased the min-heap-size to 24 MB and max-heap-size to 64 MB. But in that case also I noticed the out of memory error. The interesting thing is, the min-heap-size is never increased from 24MB and lot of free memory also.
    Memory: 24,448K Free: 12,714K (52%) ... completed.
    The Outofmemoryerror triggers from the reader thread which does the job of reading the data from the InputStream. One thing is we are continuously pushing more data on the output stream from the other end. Is that any limitation on InputStream which can hold some definite amount of data.
    Please throw some light on this.

Maybe you are looking for