Regarding remove() and clear () method

when we call clear() and remove(index) method for vector or hashtable, the element will be removed and the size decreases by one . The question is wheteher the memory will get freed when these methods are called?

Hi,
Vectors hold only references to other objects. Hence, when you "add or remove" elements to vectors, you are only adding or removing references to other objects in the heap.
Memory taken by objects in the heap is freed as per the whims of the garbage collector. Unless your program does some memory-intensive computation, the garbage collector might not even run during your program's execution phase.
If you have declared Vector v = new Vector();, the JRE will create a vector object in the heap, capable of storing 10 references. If you try to add an 11th reference to the vector, the Vector object will grow automatically by a default increment. Since in your code you are adding and removing references continuously, the Vector size will remain the same as long as the number of references never exceeds 10.
Regards,
Kumar.

Similar Messages

  • Regarding setter and getter methods

    Hi,
    Can anybody tell me the use of setter and getter methods in webdynpro .
    It is generated when we set the calculate property of value attribute to true .
    Thanks a lot .

    Hi Jain
    <b>setter</b> and <b>getter </b>functions will be created when you set the calculated propertyto true
    Consider the following scenario where in you can get some basic idea
    1) First insert a Child "Image" UI Element
    2) Create a Context in a view in which you are using Image UI Element
    3) Value Node
    Name : Image
    Cardidality : 1..1
    4) create 2 Value Attributes
    4)a ImageAlt (Calculate property - true) //this will create getter and setter methods
    4)b ImageSrc (Calculate property - true) //this will create getter and setter methods
    5)Bind the properties of Image
    alt - Image.ImageAlt
    source - Image.ImageSrc
    6) in getImageSrc()
    retrun "XX.gif"
    7) in getImageAlt()
    return "Image Not Available"
    you can even achieve getter and setter methods by doing the following procedure
    goto <b>implementation</b> tab-> rightclick -> <b>source</b> -> <b>generate Getter and Setter methods...</b>
    Best Regards
    Chaitanya.A

  • Regarding CT and Session Method in BDC ?

    Hi,
    If there are 50 records and 25th row data is having error.
    What will happen when we run it in Call Transaction and Session Method in both Foreground and Background methods ? Can anybody explain me in details ?

    Session method : the posting for the specific record will end in error, all other records will be processed.
    In foreground mode: you can correct the error manually.
    Once a session is processed, you can restart it in foreground to process the error ones...
    Call transaction:
    it depends on your program logic.
    Normally, your program will continue with the next record, unless you insert an error message in your program.
    e.g. call transaction....
    if sy-subrc ne 0.
    message e...
    endif.

  • Why does a find and replace method remove whitespace?

    I have method that searches for a string in a FM document and replaces it with a variable. If for example, there was a string foobar that I wanted to replace with the variable barfoo. Then, I expect this text:
    Lorem ipsum dolor sit amet, foobar consectetur adipiscing elit. Vivamus sed purus urna, ac tristique tortor. Nam auctor tellus non enim pulvinar a vestibulum neque tincidunt.
    To be changed to this text:
    Lorem ipsum dolor sit amet, barfoo consectetur adipiscing elit. Vivamus sed purus urna, ac tristique tortor. Nam auctor tellus non enim pulvinar a vestibulum neque tincidunt.
    However, while the text does do the replace it also removes the whitespace between the variable and the text that appears right after the variable so it actually looks looks like this:
    Lorem ipsum dolor sit amet, barfooconsectetur adipiscing elit. Vivamus sed purus urna, ac tristique tortor. Nam auctor tellus non enim pulvinar a vestibulum neque tincidunt.
    Why is the find and replace method removing the whitespace and how do I prevent that from happening? The method is provided below.
    function FindAndReplaceString(pDoc, findString, replaceVariable)
        if (typeof pDoc != 'undefined'&&typeof findString != 'undefined'&&typeof replaceVariable != 'undefined'&&pDoc.ObjectValid()&&findString.length>0&&replaceVariable.length>0)
            var vVarFmtStatus=checkVarFmStatus (pDoc, replaceVariable);
            if (vVarFmtStatus=='In Doc')
                var tr = new TextRange();
                var findParams = new PropVals();
                var frame = pDoc.MainFlowInDoc.FirstTextFrameInFlow;
                var restoreTR = pDoc.TextSelection;
                tr.beg.obj = tr.end.obj = frame.FirstPgf;
                tr.beg.offset = tr.end.offset = 0;
                findParams = AllocatePropVals(1);
                findParams[0].propIdent.num = Constants.FS_FindText;
                findParams[0].propVal.valType = Constants.FT_String;
                findParams[0].propVal.sval = findString;
                tr = pDoc.Find(tr.beg, findParams);
                var vLoopCounter=0;
                while(FA_errno === Constants.FE_Success&&vLoopCounter++< 1000)
                    pDoc.TextSelection = tr;
                    pDoc.Clear(0);
                    var newVar = pDoc.NewAnchoredFormattedVar(replaceVariable, tr.beg);
                    var varLength = newVar.TextRange.end.offset - newVar.TextRange.beg.offset;
                    tr.beg.offset += varLength;
                    tr = pDoc.Find(tr.beg, findParams);
                if (vLoopCounter>0)
                    Log (vLogFileName, 'In the document \''+pDoc.Name+'\', the string \''+findString+'\' was replaced with the variable \''+replaceVariable+'\' '+vLoopCounter+' times.\n')
                if (vLoopCounter>1000)
                    recordErrors (vErrorLog, 'ERROR: In the document "'+pDoc.Name+'", the find and replace operation was stopped after executing '+vLoopCounter+' times. The term being searched for is "'+findString+'" the replacement variable is "'+ replaceVariable+'".')
                pDoc.TextSelection = restoreTR;
                pDoc.ScrollToText(restoreTR);
                } else {
                    recordErrors (vErrorLog, 'ERROR: The find and replace operation failed because the variable '+replaceVariable+' does not exist in the following doc: '+pDoc.Name)
            } else {
                recordErrors (vErrorLog,'Invalid or unitialized parameter passed to function FindAndReplaceString')

    Hi,
    Not at the moment. Please post in http://forums.adobe.com/community/muse/ideas so other users can vote on the feature request.
    Thanks,
    Abhishek

  • I have an iPad 2 and receive e-mail through internet connection. When I delete e-mails, and clear my Trash folder, they re-appear. Setting are for remove from server when moved from Inbox. Any idea what I can do to actually delete them?

    I have an iPad 2 and receive e-mail through regular internet connection. Lately, when I delete e-mails, and clear my Trash folder, they re-appear, downloaded anew from the server and marked as unread. My e-mail Advanced Settings are selected for "Remove from server when moved from Inbox." Even when I access the e-mail accountfrom my desktop and delete the e-mails, the re-appear on my iPad. Does anyone have any idea what is causing this and what I can do to actually delete them?

    Sounds like you are looking in the wrong Administrative Group container which is why you are seeing your Exchange 2010 servers in there.
    When you install Exchange 2003 only you will see a container named by default as "CN=First Administrative Group" container. But this could be named anything if you changed the Organization Name on the installation when you installed the first
    Exchange 2003 server into the domain/forest. 
    You will notice that when you install Exchange 2010 part of the AD setup is to create a new configuration container and is named by default "CN=First Administrative Group (FYDIBOHF23SPDLT)".
    So it sounds like you are not looking in the right location within ADSIEdit. 
    You may find the following article also helpful for this issue which is the same resolution:
    http://blogs.technet.com/b/sbs/archive/2012/05/17/empty-cn-servers-container-causing-issues-with-public-folders-on-small-business-server-2011.aspx
    I recommend though that you ensure your Exchange 2003 servers are fully uninstalled or no longer present in your environment before you go deleting the Servers container though.. The following Microsoft article will help with this:
    http://technet.microsoft.com/en-gb/library/gg576862(v=exchg.141).aspx

  • Clear method and Garbage Collector

    Hi Gurus,
    Does the Clear method (hashtable, vector etc..) is a good option for garbage collection ?
    In other words, if I have a vector V with 100 elements and I perform a V.clear(), am I sure that the 100 elements are now candidates for the Garbage Collection ?
    Or is it better to write a loop performing a NULL assignment for each element of the vector ?

    Hi schapel,
    I know it's not a good idea to force the garbage collector, but let me explain what I am confronted with.
    (FYI, I didn't write the source code. Comes from a 3rd party)
    The aim is to build a jsp page which is the list of the files contained in a web server directory.
    I have a "Directory" class, and a "File" class. To build the jsp, each directory of the webserver is represented by a directory class, and each file, ...by a file class.
    To simplify, when the tree structure of the web server is build in memory, I create a jsp page to list the files, and then, I do not need the vector anymore. But the vector can be quite huge and each client will build his own vector at the begening of his session (and will never use it again during the session).
    Don't you think it's usefull in that situation to free some memory ?

  • Regarding Call Transaction and Session Method in BDC.

    Hi,
    If there are 50 records and 25th row data is having error.
    What will happen when we run it in Call Transaction and Session Method in both Foreground and Background methods ? Can anybody explain me in details ?

    Hi Naresh,
    If you are using call transaction,
    if executed in Foreground, 24 records will be posted and for 25th you will have option to correct data or skip.
    if executed in background,
    if mode is N,  24 records are processed 25th is skipped and 26th onwards is processed again.
    if mode is E, 24 records will be posted and for 25th you will have option to correct data or skip.
    For Session also it should be same the difference is that the error would be there in sessionlog and you can re-process it.
    Hope it helps.
    Regards,
    Komal.

  • Videos won't load on specific sites using Safari and FireFox. I've cleared the caches, reset Safari, removed and reinstalled Flash player, downloaded newest update.

    Videos won't load on specific sites using Safari and FireFox. I've cleared the caches, reset Safari, removed and reinstalled Flash player, downloaded newest update.

    Videos won't load on specific sites using Safari and FireFox. I've cleared the caches, reset Safari, removed and reinstalled Flash player, downloaded newest update.

  • What is the best program and/or method to have crisp clear text in FCP?

    What is the best program and/or method to have crisp clear text in FCP?
    I have the CS4 Production suite.
    Thanks

    What is the best work flow to use? For example creating text in Motion, AE, PS, or AI and then bringing it into FCP.
    I used Motion and the text looks jagged. I though Motion was vector based and I don't understand why the edges aren't crisp and smooth.
    I'm just starting to learn these programs and want to create good working habits.

  • [svn:osmf:] 14178: PARB changes: Remove unload and query methods from PluginManager.

    Revision: 14178
    Revision: 14178
    Author:   [email protected]
    Date:     2010-02-15 21:35:12 -0800 (Mon, 15 Feb 2010)
    Log Message:
    PARB changes: Remove unload and query methods from PluginManager.  We lack compelling use cases for those methods, but can easily re-add them later if we come across some.
    Modified Paths:
        osmf/trunk/apps/samples/framework/DynamicStreamingSample/src/DynamicStreamingSample.mxml
        osmf/trunk/apps/samples/plugins/AkamaiPluginSample/src/AkamaiPluginSample.mxml
        osmf/trunk/apps/samples/plugins/CaptioningSample/src/CaptioningSample.mxml
        osmf/trunk/framework/OSMF/org/osmf/events/PluginManagerEvent.as
        osmf/trunk/framework/OSMF/org/osmf/plugin/PluginManager.as
        osmf/trunk/framework/OSMFIntegrationTest/org/osmf/plugin/TestPluginManagerIntegration.as
        osmf/trunk/framework/OSMFTest/org/osmf/plugin/TestPluginManager.as
        osmf/trunk/plugins/CaptioningPluginTest/src/CaptioningPluginTest.mxml

  • Can not clear "Remove and check right cartridge" error

    I am trying to fix a 6110xi AIO printer that originally had the error "Remove and check cartridge". I have performed the following steps:
    1) Downloaded and attempted to install firmware update HpAiOFWUdate2_2.exe.  The software commented that the printer does not need the update and ended itself.
    2) Removed print cartridges and cleaned contacts on both the cartridges and the contacts within the printer
    3) Installed new ink cartridges.
    After installing the new cartridges, the error changed to "Remove and check right cartridge". The printer will now print a test page and print documents as well, but the error persists.  The printer will not scan anything at this time, and that is a highly desired operative function. I have also attempted to reset the printer with various power cycles and holding down the ENTER button and then pressing the MENU button, hearing the 3 fast beeps. How can I get the error to clear?

    Hi Lifechaser,
    I can certainly understand the frustration with all the steps you've done already. I just have a few more questions for you.
    Is the printer plugged to a wall outlet? (If not, unplug from the back of the printer first, before moving the power to a wall outlet)
    Are you using genuine HP ink cartridges? (If not, trying genuine HP may help resolve the issue)
    Get back to me with the results of these two questions and we will go from there!
    Please click “Accept as Solution ” if you feel my post resolved your issue, as it will help others find the solution faster
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    **MissTeriLynn**
    I work on behalf of HP

  • Regarding BDC and Call transaction Method

    hi gurus,
          can anyone tell the difference how many records Call transaction and Session
    Method can upload in case of single transaction and what is the time taken by each.its urgent pls.
    thanks and regards.

    Rajesh,
    u can do as many as ,
    coming to speed means it depends on server,
    if ur using session then u can calculate time ,
    with in one time h many records system will upload the records by seeing in sm35
    (first see h many records systems uploads, see the number and put the time , after one min again see the records h many it is ,) u can calculate by this.
    remember this speed will changes depends on server,
    so if u have n number of records better to do upload in weekends.
    2) if u r using call transaction method means , normally we use error file where ever record occurs that record is in error file, i think we cant analyze h many records it will be with in a time r .
    we can also check by going respective tables , just put the time and do refreshing the table after one minute , n this way u can analyze .
    Thanks

  • Got the UO52 error message. Tried the step by step method to remove and replace the print head

    still get UO52 error message after removing and replacing print head

    Hi palygirl,
    If reseating the printhead in your Canon printer does not resolve the U052 error, it is recommended that you contact live technical support . There is NO charge for this call. Real time feedback of a live technical support call would be very beneficial in this case.
    Please dial 1-866-261-9362, Monday - Friday 10:00 a.m. - 10:00 p.m. ET (excluding holidays). A Canon technical support representative will be able to assist your further.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • How do I check and clear malware from my Mac book Pro 10.6?

    How do I check and clear malware from my Mac book Pro OS x 10.6?

    Helpful Links Regarding Flashback Trojan and Virus Protection
    An excellent link to read is Tom Reed's Mac Malware Guide.
    A link to a great User Tip about the trojan: Flashback Trojan User Tip.
    To check for the trojan: Anti Flashback Trojan 2.0.4.
    A Google search can reveal a variety of alternatives on how the remove the trojan should your computer get infected. This can get you started. Or the preferred method is to use Apple's protection tool: Flashback Malware Removal Tool 1.0.
    Or, open Software Update. If you do not have the Apple protection software installed it will download and install it via Software Update. If no update appears that means you either already have it installed or it isn't needed for your system. The software is only available for Leopard, Snow Leopard, and Lion versions of OS X.
    Also see Apple's article About Flashback malware.
    For general anti-virus protection I only recommend using ClamXav.
    For the DNS Changer malware see the following:
    Will your internet service cut off on July 9?
    DCWG | DNS Changer Working Group
    How to remove the DNS Changer malware

  • I want to transfer all my iPhoto, iTunes, contacts, etc. files from my MacBook, which I am selling to a MacBook Pro. What is the easiest and safest method of achieving this? Can the files backed up on Time Machine be transferred to the Pro?.

    I want to transfer all my iPhoto, iTunes, contacts,documents, etc. files from my MacBook, which I am selling, to a MacBook Pro. What is the easiest and safest method of achieving this? Can the files backed up on Time Machine from the MacBook be transferred to the Pro in some way? I would like to capture the files as they appear on the MacBook, such as "Events" in iPhoto and the various song categories within iTunes without having to rename them all once saved on the Pro, which is the case with photos when I simply save them to thumb drive and import them to the Pro. Sny advice would be appreciated.
    Best regards,
    Rob.

    Michael,
                 Thanks for all your assistance. There is no need for apologies, Migration Assistant did indeed create a second account for the MacBook data. It has just taken me some time to figure out how to access it. I now have all the MB data in one account and the MBP files in another, which suits me fine. In fact, it is an advantage in my case as it keeps the private and business aspects separated.
    I will however try the fatcatsoftware to transfer all the iPhoto files to my iMac, where I keep my main photo library. and it will be of help to keep the events, etc in the transfer. As far as iTunes is concerned, I have HomeSharing on all my computers and this has obviated the need to worry about playlists being transferred successfully. However, HomeSharing did not appear to share the iPhone/iPod apps that were stored on the MB and although these have now come across with the new MacBook account on the MBP, I was wondering whether my iPhone and iPod will be recognised by the MBP and sync with it? Will I need to have the MB account open to achieve this or will the MBP recognise and sync with the iPhone/iPod automatically irrespective of which account is open?
    Thanks for the tip on deauthorising my iTunes account from the MB before sellng. This I will do and I believe the best way to remove all of my data from the hard drive is to reinstall the MacOSX operating system software. Is this the right approach to securely delete everything?
    Thanks again for sharing your expertise and your guidance through this exercise.
    Best regards,
    Rob.

Maybe you are looking for

  • Instablility after latest system software updates

    After running the latest software updates (from 2/15 I think - daylight savings time thing, security update, and some java thing) my system has become unstable. Every time the system attempts to go to sleep I get that "screen of death" that instructs

  • BT Infinity 2 HomeHub 5 DSL Re-sync issues?

    Hi All, I wonder if someone is able to assist. I recently migrated back to BT Infinity 2 Unlimited (FTTC) from Sky Fiber Unlimited (FTTC). (BT had a better package deal etc.) I had been with BT for several years prior to Sky without issues. This unfo

  • Recovering my music from a Zen Mi

    Hey all, I have a first generation Zen micro with the non plays-for-sure firmware on it. I recently lost my music library and i was wondering if there was any way that i could get the songs on my mp3 player back onto my computer? Opening the device i

  • Bandwidth percent - ios xr

    hi everyone, in a policy map - when you configure your classes - ex class 1 bandwidth percent 25 class 2 bandwidth percent 25 class 3 bandwidth percent 25 class 4 bandwidth percent 25 - will this negate p2mdrr or mddr? ie. have I configured the polic

  • 5508 loading cert for web auth

    I have web auth enabled on the WLC so when clients connec they get a cert error because it is using the self signed cert.  I was reading up on getting a third part cert and it explains about getting openssl and then generating the cert and sending it