How to handle memory leakage

My application need to process data from different table in MS Access database. I would store the data in the arraylist of the object class which is of the type that my application define.
It would then process to create a pdf file using iText API.
I have an batch file that call the Main program three time to create three different pdf, depending on input parameter, just as follow:
java PrintMergeReportStarter 1
java PrintMergeReportStarter 2
java PrintMergeReportStarter 3
each of PrintMerge would cause so much memory usage, but after first calling PrintMergeReportStarter, I assume that the memory would be all be free as Object life cycle would terminate. However the result not true
I have monitor the memory using the task manager in window 2000
after first time calling PrintMergeReportStart, the memory available has only increase so little. It may die at second or third java job due to "Out of Memory"
I would like to know the way to free memory. Also, would adding delay thread in java PrintMergeReportStarter help in improving this situation?
Thanks a lot for your help
Joe Wong

Instead of create 3 JVM's why don't you allow your program to handle multiple arguments on the command line, thus you only need to start the JVM once (e.g. java PrintMergeReportStarter 1 2 3)
Thomas

Similar Messages

  • Does making objects equal null help the gc handle memory leakage problems

    hi all,
    does making objects equal null help the gc handle memory leakage problems ?
    does that help out the gc to collect unwanted objects ??
    and how can I free memory avoid memory leakage problems on devices ??
    best regards,
    Message was edited by:
    happy_life

    Comments inlined:
    does making objects equal null help the gc handle
    memory leakage problems ?To an extent yes. During the mark phase it will be easier for the GC to identify the nullified objects on the heap while doing reference analysis.
    does that help out the gc to collect unwanted objects
    ??Same answer as earlier, Eventhough you nullify the object you cannot eliminate the reference analysis phase of GC which definitelely would take some time.
    and how can I free memory avoid memory leakage
    problems on devices ??There is nothing like soft/weak reference stuffs that you get in J2SE as far as J2ME is concerned with. Also, user is not allowed to control GC behavior. Even if you use System.gc() call you are never sure when it would trigger the GC thread. Kindly as far as possible do not create new object instances or try to reuse the instantiated objects.
    ~Mohan

  • How to handle "Memory Low" warning message?

    Recently users have been getting a warning message when they log on: "Memory low.  Leave the transaction before taking a break."  When we look at SM50 the user has a status of "On Hold" and the reason column says "PRIV".  We are on ECC 6.0 (since January 2010) and V7R1 (March 2011). 
    Usually the message is received as soon as the user logs on so it is not like it is related to a particular program.  We can go weeks without any reported instance of the message so it is not a regular occurrence.  Fortunately there does not seem to be any other symptom other than getting the message.
    I have seen a post on an SAP forum that said to adjust the instance profile with these parameters:
    rdisp/max_priv_time
    rdisp/wppriv_max_no
    I do not have any entries for this now and am not sure what the values should be.
    Does anyone have any suggestions on how to handle this on an AS/400?  Thanks in advance.
    Alan

    Hi Alan,
    what 1024 ???
    then we definetely do NOT need as4/MAXSHR64 !
    I would normally at least go for em/initial_size_MB = 8000 - as you are having issues right now ...
    Or is this a small DEV-system ?
    then 4000 might be sufficient ...
    (the 4096 is just crap - make it simple and use e.g. 4000 then ...)
    Regards
    Volker Gueldenpfennig, consolut international ag
    http://www.consolut.com http://www.4soi.de http://www.easymarketplace.de

  • How to find memory leakages in every screens and components in an Flex application ?

    Hi Guys,
    I was running my flex application and left it running over night.
    I noticed that it had a memory leakage issue. The memory leakage was huge upto 1.5gb
    Is there is way i can find out from where (which screen? and which component?) the memory is leaking in my application.??

    That's why FlashBuilder has a profiler.  There are some tips for use on my
    blog.
    Alex Harui
    Flex SDK Team
    Adobe System, Inc.
    http://blogs.adobe.com/aharui

  • How to handle memory error in /var/adm/messages...

    Hi,
    I am getting the following error messages often in our
    systems. Any one of you elabrate what was the problem.
    SUNW,UltraSPARC-II: [ID 470261 kern.info] [AFT0]
    Corrected Memory Error detected by CPU3, errID
    0x0005a0b0.c96402a9
    AFSR 0x00000000.00100000<CE> AFAR 0x00000000.a92fd160
    AFSR.PSYND 0x0000(Score 05) AFSR.ETS 0x00
    Fault_PC0x10025280
    UDBH Syndrome 0x1f Memory Module U0402
    SUNW,UltraSPARC-II: [ID 394986 kern.info] [AFT0]
    errID0x0005a0b0.c96402a9 Corrected Memory Error on
    U0402 is Persistent
    SUNW,UltraSPARC-II: [ID 396483 kern.info] [AFT0]
    errID0x0005a0b0.c96402a9 ECC Data Bit 44 was in error
    and corrected
    Thanks

    It looks like one of your memory modules may need to be replaced. You should probably send the log info to your support contractor for detailed analysis.
    -R

  • If i load 1GB file in labview array, it shows memory full. How tom handle it?

    if i load 1GB file in labview array, it shows memory full. How tom handle it?

    Don't read it all at once.  Just read the parts you need when you need it.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Memory Leakage in dlls called through JNI

    I have some dll that are called through a JNI code that have a memory leakage. I need to find how much is that.
    Do we have some functions for that to find it in the code.Is that possible without making changes in the JNI code.
    I checked but all suggest a memory leakage tool.But i want to do that writing a code in Java.I have checked for the Runtime class but it only finds the JVM related memory usage and not the dll one.

    amol28 wrote:
    But i want to do that writing a code in Java.Not possible. JNI/C/C++ is not java. So you can't use java to verify it.
    I checked but all suggest a memory leakage toolEither that or you manually inspect and/or test the code yourself (in C/C++).

  • How to handle a fixed length file without newline?

    Hi Experts,
    I'd like to handle a fixed length file without newline by sender file adapter.
    A file like following.
    It contains three recores."AAXBBBXCCCCX" is one record.
    AA1BBB1CCCC1AA2BBB2CCCC2AA3BBB3CCCC3
    I tried that following two parameters set. But only first recored was read.
    fieldFixedLengths
    fieldFixedLengthType
    Please tell me how to handle.
    Thanks
    Shinya Kawagoe.

    For this case we wrote a simple Adapter Module inserting an end of line character after an offset.
    This way it can be reused in many interfaces.
    And reading the whole file may not be an option in case of large source files. May cause performance / memory issues.
    eolbean.offset = <recordLlen>
    XMLPayload xmlpayload = msg.getDocument();
    byte[] content = xmlpayload.getContent();
    byte crlf = 0x0A;
    int current = 0;
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    int lines = content.length / recordLen;
    do
         lines--;
         baos.write(content, current, recordLen);
         if (lines > 0) // if other lines, eol required
              baos.write(crlf);
              current += recordLen;
    } while (lines > 0);
    xmlpayload.setContent(baos.toByteArray());
    baos.close();
    Audit.addAuditLogEntry(key, AuditLogStatus.SUCCESS,     MODULE + " Done EOLing.");

  • How to handle large images?

    Hi,
    Does anyone know how to handle big jpg images (1280*960) so that they could be presented in a midlet.
    The problem is that the images requires so much memory that they can't be decoded to an Image object with Image.createImage method. One solution would be to extract thumbnail image from exif headers. Unfortunately at least images taken with Nokia 6680 don't contain thumbnail in exif headers.
    So the only solution seems to be to decode the byte presentation of the image and resize it before creating an Image object.
    Do anybody know any library for this or tips where to start?
    Br, Ilpo

    Hi,
    I think it is not possible. My application contains a file browser (which uses jsr-75). User can use the browser to select an image either from phone memory or memory card. After the selection I would like to present the selected image for that user can be sure it is the right image. The selected image will be then sent to the server side with some additional data for further processing (but that is another story).
    Now the problem is that for example with Nokia 6680 user can take images as big as 1280*960 and I can't present them anymore because of the memory restrictions. With 640*480 image there is no problem because I can create an image object and then use a simple algorithm to resize the image for presentation.
    Br, Ilpo

  • How to handle multiple requests to the same servlet at one time?

    Hi,
    I am new to Servlets. I have doubt regarding ... Handling multiple requests to a servlet at a time.
    If we send a single request to a servlet, as know that group of objects such as servlet, servletContext, servletConfig, request, response and etc are created in the server, And if 1000's of requests are sent to a same servlet at a time, and if server memory capacity is less, then 1000's of objects are created in a server which would be heavy burden to Server. How to handle the application and development in such situation?
    Kind regards,
    veerendra

    Hi veerendra reddy ,
    By default any web server can will have a thread pool to handle client req's.
    In your point also heavy burden to server you are telling that depends on this.
    we can configure this min & max size of this thread pool.
    by default it will be 0-1000 for tomcat server.
    I am not sure in which file this configuration will be.
    But I hope in server.xml or some xml file consists this info.
    If You what you can edit accordingly. to overcome your heavy burden to server.
    Thanks & Regards
    Nagendra

  • Model of how APEX handles data (values)?

    Reference {thread:id=2486655}
    I'm trying to get a model of how APEX handles data (values). There are several places(?) that data (values) can exist. Or so it seems. I'm trying to understand how these work -- to put all the pieces together.
    Question:
    A) Where data can be?
    1) In the database
    2) In the session
    3) Rendered -- and hence displayed on the screen, if a displayed value -- but not in the session
    4) In perhaps(?) some working memory pool(?) but different from the page rendered values I see on the screen?
    5) Other?
    Why do I think this is relevant?
    Question:
    B) If there are rendered values and session values different from the rendered values, then when code executes, which of these values (rendered or session) is it executing against?
    And maybe the answer is, "You don't understand what's going on." Yes, "Exactly!" Hence the question.
    Best wishes,
    Howard

    Howard (DBA in Training) wrote:
    I'm putting this together now. For example:
    I set the value of a Page Item (say, :P2_DATA) to "BEFORE" in a Before Region process and change it to "AFTER" in an After Region Process. 'BEFORE' was displayed on the screen but 'AFTER' was in the session state. So I see that PL/SQL changes these values in the session state. But it doesn't "go back" to change the HTML after the region has been rendered -- hence we see BEFORE shown on the screen. (I'll have to think about what a Dynamic Action does.)
    Also, if a page item has a default value, say 'DEFAULT' then that value doesn't get into the session state. At least, not with my current settings. Oh, that explains a lot of confusion!! I suppose there's a logical reason for this but who would expect default values to be differently from other PL/SQL operations on the item?
    Questions:
    1) So why does a default value not get put into the session state?Several reasons, among them:
    *1. When/why is the value required?* Region items (and thus their source and default values) are rendered in region/item sequence order. The item's source/default value would therefore not be available in session state until it's rendering point. This is frequently later in page show processing than the value is actually required, such as the common use case of including a data value in the page or region title. Setting the value in a Before Header/Regions computation or process makes it available as required before the item is actually rendered.
    *2. The rendered page might not be submitted.* Default values are typically set when a page will create a new row. Consider the situation where the user clicks a "Create" button and is presented with an order entry form containing several default values. They then decide they don't want to create a new order after all, and navigate away from the form page via some mechanism that uses a redirect rather than a submit (such as a default "Cancel" button). This means that no page submit processing is performed, and generally that no session state management is performed. If the default values were set in session state, the order entry page would contain the default values for the non-existent order despite the user never submitting it. This may have unwanted side-effects if these values are referenced elsewhere in the application, and therefore would require extra session state management to be built into the application.
    *3. A rendered item might not be submitted with the page.* Per the HTML specification, the values of disabled controls unchecked checkboxes are not POSTed on page submit. Consider a situation where a checkbox item is set with several default values, but the application requires that the checkboxes be cleared and disabled by a dynamic action if the user chooses certain options from a select list. In this case, on page submission no values are submitted into session state for the checkbox item. If the defaults had been set in session state, then the application would be in an inconsistent state, with the user-selected option indicating that none of the checkboxes were checked, but with session state holding values showing that they were. This would require additional processing to ensure that the application's state was consistent before saving it to the database.<sup>1</sup>
    2 & 3 are particularly significant in basic wizard-generated applications. Doing things in this way, the wizard-generated DML and navigation "just works", without the need for additional session state management.
    2) Is there a Page Item setting that causes the default value to be saved to the session state?No. Hopefully the explanations above provide sufficient reason to show why this is genearlly not desirable. On the rare occasions when it is required, set the session state value using a computation or process.
    <sup>1</sup> There are other reasons&mdash;mainly security related&mdash;that make it good practice to perform such checks in more complex and internet-facing applications anyway.

  • How to handle too many custom UITableViewCells in UITableView?

    In my iphone app, I need to display many custom rows (maybe thousands or even more) in the UITableView. I add one custom UIView onto each UITableViewCell in "- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath" function, so there will be allocate much memory for the all my custom UIViews. When I add 500 rows into the UITableView, the memory ran out, then the app crashed. I think maybe there is something wrong with my code or design, I don't know how to handle this (thousands custom rows in UITableView). Please help me.... Thanks very much..
    Below is the my code:(if I have thousands of rows, the following code will allocate thousands of CustomViews), is there any way that not allocate so many CustomViews?
    // Customize the appearance of table view cells.
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
    **cell = [[[UITableViewCell alloc] initWithFrame:CGRectMake(0, 0, 110, 25) reuseIdentifier:CellIdentifier] autorelease] ;
    // Set up the cell...
    CustomView *cellView = [[CustomView alloc]initWithFrame:CGRectMake(1, 1, 108, 24)];
    [cell addSubview: cellView];
    [cellView release];
    return cell;
    }

    Hi,
    well you should add the customView if you need to create a new cell only. Any reused cell will contain this customview allready since you've added it when the cell was created.
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
    cell = [[UITableViewCell alloc] initWithFrame:CGRectMake(0, 0, 110, 25) reuseIdentifier:CellIdentifier] autorelease];
    // Add customView to new cell's only
    CustomView *cellView = [CustomView alloc] initWithFrame:CGRectMake(1, 1, 108, 24)];
    [cell addSubview: cellView];
    [cellView release];
    // Set up the cell...
    return cell;

  • How to detect Memory Leaking Problem in Java

    I have a Java multithreading program & I suspect that there is a memory leaking issue in the program. Can someone tell me how can I know how to detect where is the memory leakage in the program?
    I have download a few tools like hat, jprobe, optimizeit but not sure how to use it. I am using jdk1.3.0 in HP-UX
    Thks

    Not so true, you could have a memory leak if you accidental hold on to a resource, or maybe you have threads running that you have no reference to, and those threads hold some resources.
    Optimizeit is pretty easy to use. You start you application with Optimize it, so Optimizeit is you JVM so to speak. In optimizeit you can get a list of active objects. If this list grows and grows, you probably have a problem. Let it run for a while, and see which objects are the most present, dubble-click it, and it lets you step down into you methods. This way you can maybe find you leak.
    Good luck :)

  • Find memory leakage when passing Object Reference from Teststand to vi

    I am using Teststand to call labview vi, and pass ThisContext of sequence to vi as object reference, but if I just loop this step and I can find the memory using keep increasing, how can I avoid the memory leakage inside the vi.
    see my vi, it is to post message to UI.
    Solved!
    Go to Solution.

    You should be using a close reference node to close the references you get as a result of an invoke. In the code below you should be closing the references you get from the following:
    AsPropertyObject
    Thread
    Close those two references once you are done with them.
    Also make sure you turned off result collection in your sequence or you will be using up memory continually for the step results.
    Hope this helps,
    -Doug

  • Memory leakage with swing

    We have developed a applet using swing componenets . We have used dispose, callled gc() and made references null and removed the listeners to enable the components for garbage collection. We have used windows NT. When we see the task manager the memory usage only increases as we work on the applet. When we minimize the browser and maximise it again then the extra memory is releaased but as long as we work on the browser though we have done lot of things the memory usage in task manager only increases. Can you help us out. What are the reason for memory leakage . Why the memory is not released by the jvm to OS. Is it designed that way. What are the precautions to take. We use JDK1.2 for developing and run the applet with the jre1.2 and jre1.3 plug in installed on the windows nt system
    Thanks in advance

    Hi there
    This topic has been discussed several times before
    Basicly this is it
    The GC knows it is sluggish (well those who built it any whay)
    therefor it will not clean up until it is necessary
    therefor your memory for the JAVA app will grow in
    memory size (as long as there is more room why clean?)
    When you start/close another program the OS will
    demand more memory and the GC will run cleanup. How effective this cleanup realy is
    depends on the situation.
    To make things easier for the GC you should as you state
    clean all referenses etc
    If you whant to start another memory consuming program
    you should start it before the Java App. then the memory that is available for the Java VM is limmited.
    There are also whays to set the maximum / minimum memory for the Java VM
    Markus

Maybe you are looking for

  • Missing images in output to Word 2003

    When I embed the images in the printed doc output, they show up in the word 2003 doc as a box with an X in it. Why? I have tried bumping up the virtual memory on my machine - that didn't solve it. If I "link" the images, they show up, but I cannot li

  • MOVED: Problem with CPU Voltage

    This topic has been moved to Overclockers & Modding Corner. https://forum-en.msi.com/index.php?topic=140957.0

  • Can I use Facetime on my i-touch 4 while in China?

    I will be traveling to Shanghai in a week and I want to use facetime with my daughter.  We both have the newest generation I touch.  I know China has some restrictions on internet, so I wanted to find out if this affected my i-touch.

  • SCRIPT  Include text allignment

    Hi Friends,   I want print the Include text(Service text) within one column(alignment). Iam displaying 6 columns in page like item. description, qty, units, price , total ..(6coloumns).. I want dispaly service text for each Item... I am getting the S

  • Iphoto 11-File import RAW and JPEG

    iPhoto 11, Snow Leopard 10.6.7 RAW supported and Sony DSLR A300 supported... My question is simple: I understand (i think) that when I import pictures into iPhoto that they will be converted to JPEG. I have a number of JPEG files. But if I shoot some