Memory Leak: Do I need to explicitly free memory reference for collection?

Hi,
My web application uses JRockit JDK 1.4.2, Java Servlet, JSP &Struts. It is a clustered environment using WL 8.1 sp 4. I am investigating whether there are any memory leaks in the application & what are best practices to avoid leaks.
A specific scenario is as follows:
For an incoming request, the struts action class creates object �O� (of class A) and set �O� as a request attribute. This request attribute is used to display values on the JSP.
Now, class A has a heavily nested structure: Class A has object of class B, where B has a HashSet of objects of type C and where C has an object of type D and E.
Though I set this object �O� in request scope, do I need to explicitly nullify any of the references within object �O�? Can �not doing this� result in a memory leak?
Thanks in advance,
sjaiprakash

jEnv->ReleaseStringUTFChars((jstring) jStr, str);free(str); //Is this line valid or outright wrong?Outright wrong.
Another question is if ReleaseStringUTFChars actually frees str then will it set str to NULL?No, that's impossible by the semantics of C and C++.
I guess not as we are not sending this pointer by reference.Exactly, so what you described is impossible. No need to ask really.
My last question is if str is NULL then calling ReleaseStringUTFChars over it can cause any problem?How could it be null? If it comes from GetStringUTFChars that's impossible, and if it doesn't you don't have any business calling ReleaseStringUTFChars() on it, whatever its value.

Similar Messages

  • My macbook pro's memory is full and I purchased an external hard drive. I am using timemachine, but need to earse/free up some memory on my laptop. How do I do this?

    My macbook pro's memory is full and I purchased an external hard drive. I am using timemachine, but need to earse/free up some memory on my laptop. How do I do this?

    Christinag1317 wrote:
    My macbook pro's memory is full and I purchased an external hard drive. I am using timemachine, but need to earse/free up some memory on my laptop. How do I do this?
    Ok when you refer to "memory" that is the Random Access Memory which is temporary memory the processor (worker) uses to store stuff while it's using it. Power goes off whats in the memory is gone.
    Your storage drive is where data is pernamnetly stored if the power is on/off.
    So what you really mean to say is your storage drive is filled up and you need to make some room.
    You have a TimeMachine drive, what this does is makes a image of your internal storage drive as a backup method, it also allows some "back in time" restoration of your previous deleted files depending how much space is on that drive. The more space, the less data you have, the more days you can go back in time to retrieve something.
    Unfortunatly the TimeMachine drive is not a extra space storage drive, it automatically rotates what appears on your internal storage drive. So if you delete something from the internal drive, it eventually gets deleted from the TimeMachine drive.
    So you need to make some more room on your internal drive, this is rather easy, all you need is ANOTHER external drive and connect it to the Mac. Give it a name like ExtraStorage#1 and thenyou will have to decide which of your User files you really don't need on the internal drive.
    For instance the best choice would be to move some movies out of your Movies folder to another MoviesExtra folder on the ExtraStorage#1 drive.
    Movies take a LOT of drive space and you can always copy them on or off, or watch them from the ExtraStorage#1 drive as well. But if your going to do this a lot, you should consider getting a Firewire 800/400, USB 3,2,1 combination drive as Firewire 800 is fastest and decently priced (Thunderbolt is very high priced and overkill at this time)
    The other things like Documents are quite small, Pictures can take a lot of space if you have a lot, but if you need them on the internal drive then that's better. Music one tends to use a lot or manage playlists and such, but perhaps some music you may which to move off or "prune", I suggest always burning data DVD's of music especially for extra backups.
    Once you have freed some room on the internal drive, this liitle neat program will show you what is taking the largest amount of space on your internal drive.
    http://grandperspectiv.sourceforge.net/
    After a scan, right click on the big squares to "revel in Finder" to show you what's taking the largest amount of space, be warned it also opens up hidden system files and folders, which you won't be able to move. So concentrate on what's inthe Users folder.
    Likely if you have a lot of Movies this is the biggest culprit on most standard internal hard drives. Also if you have something in iTunes that's auto-downloading something like PodCasts and not deleting the older ones and you forget. So go there and fix things and that can free up drive space.
    If you bought a small SSD with your new Mac, then the price of that SSD has come back to haunt you with low storage space, you will have to think carefully what you can live without on the internal drive.
    Once you have slimmed things down, TimeMachine will update to reflect your slimmer internal drive. What this means is there is only one copy of your data on the ExtraStorage#1 drive.
    You need to maintain two copies of your data at all times on seperate hardware, so now you need ANOTHER storage drive (ExtraStorage#2) to copy everythinng of ExtraStorage#1, or else if you drop or have a mechanical problem with ES#1 all that data will be gone!
    If you wish to learn more then I suggest reading these two links
    https://discussions.apple.com/message/16276201#16276201
    http://pondini.org/OSX/Home.html

  • I need to know free login for itunes so please provide me necessary information on free procedure of free downloading apps of apple.

    i need to know free login for itunes so please provide me necessary information on free procedure of free downloading apps of apple

    Follow the instructions on this page when creating an account : http://support.apple.com/kb/HT2534

  • We have always used one iTunes account and I want to crate a new account for my daughter.  What is the best way to go about this and will she need to download free apps again?

    We have always used one iTunes account and I want to crate a new account for my daughter.  What is the best way to go about this and will she need to download free apps again?

    Not going to happen the way you want it to.
    When you add a gift card balance to the Apple ID, it's available for the Apple ID.
    Probably best to create unique Apple ID's for each... this will also make things easier in the future as purchases are eternally tied to the Apple ID they were purchased with.

  • I'm trying to manually sync my music to my iPhone but it needs so much free space

    I used to be synced to a different iTunes on a different computer. Now that I have my own laptop with my on music library I'm trying to sync it to my phone. I have to do it manually because I don't have enough space on my phone to sync my entire music library. But every time I try to sync it, it will tell me that it's unable to sync because it needs "at least 3.something more GB of space in order to sync" and every time I unselect an artist it will say it needs more space until I have barely any of my music selected. Why does it need so much free space? Like it requires approx 5GB of free space in order to sync my music and I don't understand why. I've never had this issue before. I even imported all of my pictures to my laptop so I could delete them to make room for my music. Please help me.

    Hi there Sarbunn,
    You may find the information in the article below helpful if there is not enough free space on your device to sync.
    If you get a "Not enough free space" alert on your iPhone, iPad, or iPod touch 
    -Griff W.  

  • Do you need 60GB of free space?

    Sorry if this has already been asked.
    If I buy a 60GB iPOD, do I need 60GB of free space on my computer to be able to fill up my iPOD? If I only have 40GB free on my computer, tben will I only be able to put 40GB of music and video on my iPOD?
    Thanks
    Allan

    you don't have to keep stuff on your computer's HDD after downloading to the iPod. hence, one of the benefits of having more space on your pod.
    A few words of caution if you choose to do this. BACK UP YOUR LIBRARY TO SOME SORT OF EXTERNAL MEDIA! Backup to CD, DVD, external hard drive, tape... something. Do NOT rely on your iPod as your single repository for your music.
    At some point, your iPod may need to be restored, and if it is the only place you have your music, you will lose it.

  • Free oracle DB downloadDeveloper and i am in need of a free oracle database

    I have installed Sql Developer, and i am in need of a free oracle database. where i could download free database from.

    Hi,
    Good to hear you are making progress. Try either Oracle 11g XE (or Oracle 10g XE if you older technology with a smaller footprint is better for you):
    http://www.oracle.com/technetwork/database/express-edition/downloads/index.html
    Regards,
    Gary
    SQL Developer Team

  • Need a Free designing program. for example: something to help me make shirt

    Need a Free designing program. for example: something to help me make shirt graphics, posters, and other designs. i do not think my mac came with any such program. i have ilife 08 but i dont think anything there can help me?

    Got to VersionTracker or MacUpdate and search.

  • I need a free IDE (Environment) for programming

    Hello
    I need a free IDE (Environment) for making java card Applets.I want this environment have a good debuger and it works with javacard 2.1 or later.
    Please hellp me.
    Thanks

    Good day.
    To developers Cardlet (Applets to loads in smart card) not is necesary some IDE in particular, that you need is have all the library for java of the version javacard that you use and configure you IDE (that's CLASSPATH).
    Very IDE are very good JBuilder, JDeveloper, Eclipse, and others; you cna find this for Windows, Linux, Solaris and Mac normaly.
    The firts you need is obtain some this and check which the this is more easy for use to you.
    Good lock.

  • Hello, i need a free java editor for rtf file !

    hello, i need a free java editor for rtf file , that its compatible
    with wordpad of windows, i have tried some of it but they are not compatible ,
    example: not mantain the tabs and the formattings of the text.
    Thanks

    hello, i need a free java editor for rtf file , that
    its compatible
    with wordpad of windows, i have tried some of it but
    they are not compatible ,
    example: not mantain the tabs and the formattings of
    the text.
    ThanksWhy are you using rtf files? .java files are plain text with no formatting info.

  • I need a JDeveloper free trial

    Hi:
    I need I JDeveloper Free trial for win95, where can I
    download it?
    Thanks
    null

    I have downloaded JDeveloper trial version - both in batch
    format and using the whole .zip file NEITHER of them work with
    the WinZip utility! I get an error message indicating that
    the .zip file is not a proper archive file. I run the batch
    option and it says that 13180360 bytes are missing. I
    downloaded EVERYTHING and ran the .bat file as instructed.
    Also, after calling ORACLE about the problem, they said that
    there was nothing that could be done and that it was not
    their problem.
    Needless to say, I am somewhat disgusted!
    JDeveloper Team (guest) wrote:
    : Hi
    : JDeveloper is certified for WinNT platform only and you can
    : download this from technet.
    : regards
    : raghu
    : Eugenia Borrell (guest) wrote:
    : : Hi:
    : : I need I JDeveloper Free trial for win95, where can I
    : : download it?
    : : Thanks
    null

  • I need free trial license for ADEP

    i need free trial license for ADEPi need free trial license for ADEP

    I don't think so, but I don't work for Adobe... and this is an open forum, not a direct link to Adobe support
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"

  • Do Do I need to explicitly close a blazeds channel, when I create it at runtime?

    Hi,
    In my application, I am creating 5 blazeds channels dynamically.  I am doing something similar to the following example:
    http://cookbooks.adobe.com/post_Performance_tip__Use_multiple_duplicated_remote_ob-10663.h tml
    Do I need to explicitly close these channels?
    Thanks

    No, I meant a Report object in Forms Builder Report node for this to work:
    V_REPORT_ID:= FIND_REPORT_OBJECT('REPORT');For the OP: you do not need to add a specific report to a Form. Use a general report object and set the actual report file name with:
    SET_REPORT_OBJECT_PROPERTY(V_REPORT_ID, REPORT_FILENAME, <report>);Edited by: InoL on Aug 16, 2012 9:31 AM

  • I already updated! The version iOS 6.0.1 without include me the McTube or MxTube. The McTube free I was using, capacity for 10 videos download only. I need McTube Pro free! What's your Idea?

    I already updated! The version iOS 6.0.1 without include me the McTube or MxTube. The McTube free I was using, capacity for 10 videos download only. I need McTube Pro free! What's your Idea?

    I already updated! The version iOS 6.0.1 without include me the McTube or MxTube. The McTube free I was using, capacity for 10 videos download only. I need McTube Pro free! What's your Idea?

  • If I buy an unlocked and contract-free iPhone 4s for my T-mobile, do i need to cut my sim.

    If I buy an unlocked and contract-free iPhone 4s for my T-mobile sim, do i need to cut my sim.

    Beyond what had been said about unlocked phones and limitations of iPhones on the T-Mobile network, T-Mobile appears to sell microSIMs:
    http://www.t-mobile.com/shop/phones/cell-phone-detail.aspx?cell-phone=t-mobile-m icro-sim-card
    I am not a T-Mobile customer so best to call them and ask.

Maybe you are looking for

  • How to increase the number of row displayed in the result set.

    Hi All, I have a seeded oracle page OA.jsp?page=/oracle/apps/pa/structure/webui/FPStructVersionPG from projects module. On the above page, when we click on the financial tab to see the tasks, it shows only 180 tasks out of 298. I dont find any link o

  • Problem of Query of Module Purchase Order, Good Receipt PO, Good Return

    Hi, I would like to seek for assistance regarding double entries of documents,  I have used the query and found out lately the it has a problem, Please refer to thread "Query of Module Purchase Order, Good Receipt PO, Good Return" for details. You he

  • How much does it cost to make an App?

    This would be very helpful information. Need help?

  • Materialized view reg

    Hi all, I am reading about materialized view from 9i documentation. In this it is mentioned that for updatable materialized views one needs to have updatable materialized view log, but it is not given the log has to be created by us like the material

  • Call iexplore.exe from apex page

    I have a requirement to have a link from my main application apex page to invoke a client windows os command 'iexplore.exe -noframemerging' (I think this ie option used to be -nomerge). The idea is, this will fire up a separate IE8 session in a separ