Clearing memory map of maps?

Hi I have the following Class:
public class TestClass{
Map<String, Map<String, String>> aMap = new TreeMap<String, Map<String, String>>();
public void addStuff () {
//this adds things to aMap
public void clearMap() {
aMap = new TreeMap<String, Map<String, String>>();
Does my clearMap method make all memory used by this map ava. for garbage collection? What is the proper way to clear all memory to reset the aMap variable? Thanks.

user12374594 wrote:
What is the proper way to clear all memory to reset the aMap variable?There is no one proper way to clear it. You can do what you're doing, or you can simply call aMap.clear(). The only significant difference is whatever it means in terms of your class's semantics whether you have a completely new map or the original map with nothing in it.
However, one doesn't generally think in terms of "clearing memory" in Java. You hang on to a reference as long as you need to use it for your code to do its job, and when you no longer need it, you let the reference go. GC takes care of the rest, and it's not often that you have to even think about it.

Similar Messages

  • What is the diffrence between  map and map.entry in core java

    what is the diffrence between map and map.entry in core java . where it will be use ful. any one give one example plz.

    A Map contains Map.Entry's
    e.g.
            Map map = new LinkedHashMap(8);
            map.put(new Integer(1), "one");
            map.put(new Integer(2), "two");
            final Iterator iterator = map.entrySet().iterator();
            while (iterator.hasNext()) {
                Map.Entry entry = (Map.Entry) iterator.next();
                System.out.println("key=" + entry.getKey() + ", value=" + entry.getValue());
            }

  • XSLT MAPPING/JAVA MAPPING

    Hi All,
       After faceing so much of problem, i found that it would be better if i can go for an XSLT/java mapping:
    1. It is adding an extra <b>ns0</b> to header line & end line which i dont want to be generated in the output xml file.
    2. Namespace problem that basically sticking to 60 but i want 72 characters in my target xml file.
    3. No carriage return at the end of each line which is not geting generated through graphical mapping.
    Now i have an XSD provided by the client. So how can i use that and which mapping should best suits to solve all these problem.
    Should i go for a java mapping or an XSLT/JAVA mapping.
    I dont have any idea on both of them, So can you people send me the details for it.
    Many Thanks & Best Regards,
    JGD.

    Hi,
    Based on the requirement and size we can choose the mapping.
    If java is suitable to our requirement then we go for java.
    If XSLT is suitable to our requirement then we go for XSLT.
    Performance wise(high --> low) :
    If data is less then
    Graphical mapping -
    > Java(sax parser)mapping -
    > Java(dom parser)mapping -
    > XSLT mapping -
    > ABAP mapping.
    If data is high then
    XSLT mapping -
    > Java(sax parser)mapping -
    > Graphical mapping(internally it uses SAX)----> Java(dom parser)mapping -
    > ABAP mapping.
    If you choose XSLT then you can select Altova Map Force tool then no need to  write the XSLT code here, it will automatically generates the code.
    N:1  XSLT Mapping
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30ac53f2-21d7-2a10-afa2-ce1a0577ca18
    XSLT mapping https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/006aa890-0201-0010-1eb1-afc5cbae3f15

  • How do I display a map in map view?

    How do I display a "map" in map view?

    You can't.  The mapping was provided by Yahoo!, which discontinued the service.
    Ken

  • How to import a Google Map API Map in Adobe Muse

    Hello,
    I'm trying to import on Adobe Muse a Google Maps custom map that I have created with the API google maps... But I have problems with writing the HTML code...
    I tried to import that one for exemple:
    https://developers.google.com/maps/documentation/javascript/examples/map-simple?hl=fr
    But nothing happens in Adobe Muse... just a blue square with "html" written on the left top of the square...
    Thanks for the help!

    Hi!
    You have to create to go to "insert html code" in the Muse menu.
    Then follow the steps in these websites, some are in french...sorry about that! but It's not difficult to understand, or use google translate.
    http://www.html5-css3.fr/html5/tutoriel-api-google-maps-geolocalisation-html5
    https://developers.google.com/maps/documentation/javascript/examples/map-simple?hl=fr
    http://gmaps-samples-v3.googlecode.com/svn/trunk/styledmaps/wizard/index.html ==> for creating the customized map
    http://www.code-web.org/post/2010/03/04/Google-Map-API-V3-%3A-Placer-un-marker-sur-la-cart e ==> for customized markers
    https://developers.google.com/maps/documentation/javascript/examples/map-geolocation?hl=fr &csw=1
    https://developers.google.com/maps/documentation/javascript/tutorial?hl=fr
    http://www.lafermeduweb.net/tutorial/mettre-en-place-la-google-maps-personnalisee-sur-ses- pages-web-p105.html
    Hope this will help!

  • Help me please : Serious problems with collection-mapping, list-mapping and map-mappi

    Hi everybody;
    I have serious problems with list-mapping, collection-mapping and map-mapping.
    Acording to specifications and requirements in a system I am working on it is needed to
    get a "list" of values or an indivudual value.I am working with ORACLE 9i Database,
    ORACLE 9i AS and ORACLE 9i JDEVELOPER.
    I tried to map a master-detail relationship in an entity-bean, using list-mapping.
    And this was very useful in order to get a "list" of details, ...but, when I wanted
    to get a single value I have some problems with persistence, something about "saving a state"
    despite I just want to get the value of a single detail.
    I decided to change it to map-mapping and the problem related with a single detail
    worked successfully, but I can get access to the whole bunch of details.
    May anyone of you help me with that?
    I am very confused I do not know what to do.
    Have any of you a solution for that problem?
    Thank you very much.

    Have you tried a restore in iTunes?

  • IPAD 16 GB HOW TO CLEAR MEMORY

    IPAD 16 GB HOW TO CLEAR MEMORY ios7

    What do you mean by 'clear memory' ?
    You can close apps via the iPad's taskbar (a lot of the apps that show on the taskbar will just be 'recently used', they won't be using resources) : from the home screen (if you have an app 'open' on-screen then it won't show on the taskbar for closing) double-click the home button to bring up the taskbar at the bottom of the iPad's screen, then press and hold any of the apps on the taskbar for a couple of seconds or so until they start shaking, then press the '-' in the top left of the iTunes app to close it, and touch any part of the screen above the taskbar so as to stop the shaking and close the taskbar.
    If you want to delete content from your iPad to free up storage then you can see how much space each app is taking up via Settings > General > Usage. To delete an app (and therefore its content) press and hold any of the apps on your iPad’s homescreen and after a couple of seconds or so they should start to shake. Then press the 'x' in the left corner to delete the ones that you don't want, and when you've finished deleting press the home button so as to stop the shaking. If you don't get the 'x' on any of the apps that you've downloaded (you can't delete built-in apps) then check that Settings > General > Restrictions > Deleting Apps isn't set 'off'.
    To do a soft-reset (i.e. a reboot) : press and hold both the sleep and home buttons for about 10 to 15 seconds (ignore the red slider), after which the Apple logo should appear.

  • Clearing memory in ActionScript 3.0

    Does anyone know how to clear memory in AS3.0. My app loads a lot of SWF and the memory usage keep accumulate and does not go down untill the app crash. I've tried flash.system.System.gc(); , set movie clip to null,and removeChild but seems no luck for me.
    This is how i trace the memory usage:
    var mem:String = Number( System.totalMemory / 1024 / 1024 ).toFixed( 2 );
    trace( "RAM Usage: "+mem+"MB" ); // eg traces “24.94Mb”
    Any help means a lot to me. Appreciate in advance.
    Amir

    This article should give you more insight:
    http://www.rgbeffects.com/blog/uncategorized/flash-optimization-freeing-memory/
    It`s also memorable that manually calling the GarbageCollector only works in AIR and the Debug-Version of the Flash Player.

  • Value mapping, interface mapping, standard funtions and user defined functi

    I like have more information abt live scenario's use of value mapping, interface mapping, standard funtions and user defined functions.
    How to create user defined funtions and how to use it in XI?
    thanks in advance
    shiva

    Hi,
    Interface mappings register your mapping program for an interface pair in the Integration Repository. If you require a mapping at runtime, it is sufficient to select the interface mapping for the interface pair at configuration time .The Integration Server uses the interface mapping to identify associated mapping programs for request messages, response messages, fault messages, or all three.
    Features
    Executing Multiple Mapping Programs for One DirectionBy using an interface mapping you can execute multiple mapping programs consecutively for the transformation of a request or response message. In such cases, an interface mapping comprises multiple steps for which the following applies:
    &#9679;     The steps are executed in the sequence specified (from top to bottom). The result of the mapping program from the previous step is forwarded to the mapping program of the subsequent step.
    &#9679;     Each step can reference a mapping program that executes a 1:1, 1:n, n:1, or an m:n transformation. In the case of multi-mappings (1:n, n:1, or m:n), the previous step must create the same number of messages that the subsequent step expects.
    &#9679;     Multi-mappings use one envelope to put all messages in one structure. If one of the steps references a multi-mapping program, all subsequent steps must use the same envelope.
    The mapping for a request message comprises two message mapping programs: one 1:1 transformation and one 1:n transformation. Since the latter message mapping uses the multi-mapping envelope for both the target message and the source message, the message mapping for the 1:1 transformation must also create a transformation result with a multi-mapping envelope.
    You do not strictly need to divide up one direction of the whole mapping into different steps. However, this enables all the message formats in one system landscape to be mapped to a central message format, for example. This results in less mapping programs being required because you no longer need to be able to map all the different message formats to each other
    Activities
           1.      Create a message mapping on the design maintenance screen of the Integration Builder (see also: Creating an Object).
    You can also create multiple interface mappings for the same interface pair.
           2.      Enter the source and target interfaces that require a mapping of the request message, the response message, the fault message, or all three, in the table of the same name. The following restrictions apply:
    &#9675;     If you want to use the interface mapping in a transformation step in an integration process, you must only specify abstract message interfaces. Furthermore, all objects (integration process, interface mapping, and all objects that reference the interface mapping) must be in the same software component version. If you want to reference objects from underlying software component versions, you must access the objects from the Basis Objects branch (in the navigation tree or using an input help).
    &#9675;     If you want to map multiple messages to each other by using a multi-mapping, you can only specify asynchronous interfaces (for further restrictions, see: Multi-Mappings). If any message interfaces are missing, you can also create them by using the function Create New Object ().
    If the interface cannot be imported or cannot be created in the Integration Repository (in the case of an external adapter, for example), you must enter the interface names manually. However, it is not possible to check the technical name in this case.
           3.      To import the properties of the interfaces, choose Read Interfaces. The table in the lower area displays tab pages for the request message, response message, and if available, for the fault message, for each mode of the interfaces (either synchronous or asynchronous).
           4.      To develop an external mapping program, export the XSD schema of the respective request or response message as a zip file after you have imported the interfaces. The zip file can contain multiple schema files that reference each other, for example in a multi-mapping. In this case, the schema with the global message element has the name MainSchema.
           5.      To reference a mapping program for the respective message, you have the following options:
    &#9675;     Select an existing mapping program from the Integration Repository by using the input help (). If this is a message mapping, the default setting of the input help only displays those message mappings that are found using the source and target message in the Integration Repository (in multi-mappings, the first source and target messages are used as the search criteria). However, you can also display any number of message mappings, for example, because you are constructing a mapping from several mapping programs with intermediate instances which have no message types.
    &#9675;     You can create message mappings directly from the interface mapping. To do this, select the mapping type Message Mapping in the Type column. Position the cursor in the Name column and choose the function Create New Message Mapping () in the Mapping Program frame. The Integration Builder copies the specifications of the messages and their occurrence directly from the interface mapping.
    An interface mapping can only reference mapping programs that belong to the same or an underlying software component version of the interface mapping. This ensures that the mapping program can be shipped together with the interface mapping (see: Software Logistics).
           6.      If it is not a mapping for a fault message, you can execute multiple mapping programs in succession for request and response messages:
    &#9675;     To insert an additional line for a mapping program, choose .
    &#9675;     To delete the registration for a mapping program, choose .
    At runtime, the mapping programs are executed from top to bottom.
           7.      Save the interface mapping.
    Regards
    Aashish Sinha
    PS : reward points if helpful

  • Type "purge" in Terminal and get:   -bash: purge: command not found   Is there another built-in command to clear memory leaks?   want to clear memory periodically

    I have 10.6.8.  When I type "purge" in Terminal I get:   -bash: purge: command not found   Is there another built-in command to clear memory leaks?   I have FreeMemory (works well) and considering FreeMemory Pro, to clear memory periodically, say every 20 minutes, or preferably when a threshold is reached, say when only 100MB is available.

    To get purge to work you need to install Xcode from Optional Installs on the 10.6 install DVD. Also be sure you install CHUD Tools with it.
    But running purge or anything like it is pointless if within a short period of time the VM just grows back again. Sounds like you need more RAM.
    Where are the memory leaks? Just because the VM reaches a certain size doesn't necessarily mean it's from a memory leak.

  • I have a question - Does Oracle BI in cloud has visualisation like Heat map, tree map , spatial map ? In general what are the additional visualisation as compared to OBIEE if any , thanks

    I have a question - Does Oracle BI in cloud has visualisation like Heat map, tree map , spatial map ? In general what are the additional visualisation as compared to OBIEE if any , thanks

    I have a question - Does Oracle BI in cloud has visualisation like Heat map, tree map , spatial map ? In general what are the additional visualisation as compared to OBIEE if any , thanks

  • I am unable to clear memory.  Usage, in Settings, just spins.  I have erased pics and that did nothing.

    I Am unable to clear memory.

    If you deleted photos from the Camera Roll album they may still be on your iPad. Check the Photos app and look for the Recently Deleted album. Photos reside there for 30 days in case you want them back. If you are sure that you want to delete the photos deleted them from the Recently Deleted album.

  • How to define map of maps?

    Hello,
    i want to do something like that in pl/sql:
    TYPE map_type
       IS
          TABLE OF NUMBER
             INDEX BY VARCHAR2 (1);
       --    map: 1 -> 'a'
       --         2 -> 'b'
       --         11 -> 'A'
       --         22 -> 'B'
       TYPE map_of_map_type
       IS
          TABLE OF map_type%TYPE
             INDEX BY VARCHAR (15);
       --          map: 'onedigit' -> { {1 -> 'a'}, {2 -> 'b'} }
       --               'twodigit' -> { {11 -> 'A'}, {22 -> 'B'} } Is something like that possible?
    Thanks!

    And to illustrate how you work with two dimensional associative array:
    SET SERVEROUTPUT ON FORMAT WRAPPED
    DECLARE
        TYPE map_type
          IS
            TABLE OF NUMBER
              INDEX BY VARCHAR2(1);
        TYPE map_of_map_type
          IS
            TABLE OF map_type
              INDEX BY VARCHAR(15);
        v_map1 map_type;
        v_map2 map_type;
        v_map_of_maps map_of_map_type;
        v_idx1 varchar2(10);
        v_idx2 varchar2(1);
    BEGIN
        v_map1('a') := 1;
        v_map1('b') := 2;
        v_map2('A') := 11;
        v_map2('B') := 22;
        v_map_of_maps('onedigit') := v_map1;
        v_map_of_maps('twodigit') := v_map2;
        v_idx1 := v_map_of_maps.FIRST;
        FOR i IN 1..v_map_of_maps.COUNT LOOP
          DBMS_OUTPUT.PUT_LINE('Map of maps: ' || v_idx1);
          v_idx2 := v_map_of_maps(v_idx1).FIRST;
          FOR j IN 1..v_map_of_maps(v_idx1).COUNT LOOP
            DBMS_OUTPUT.PUT_LINE('     Map: ' || v_idx2 || ' = ' || v_map_of_maps(v_idx1)(v_idx2));
            v_idx2 := v_map_of_maps(v_idx1).NEXT(v_idx2);
          END LOOP;
          v_idx1 := v_map_of_maps.NEXT(v_idx1);
        END LOOP;
    END;
    Map of maps: onedigit
         Map: a = 1
         Map: b = 2
    Map of maps: twodigit
         Map: A = 11
         Map: B = 22
    PL/SQL procedure successfully completed.
    SQL> SY.

  • As clear memory dead Switch cisco 2960

    Hello All !!
    As Clear memory dead process I/O Switch cisco 2960 ?

    I do not speak English perfectly, I'll try to summarize 
    Switch this process my memory I / 0 Very High, restart several times, but the process does not diminish.
    thank you.

  • Clear memory

    Hi everyone
    Is there a command in action script to free the memory of Illustrator , to force the situation like
    when i close a document by the 'x' or use the 'Ctrl W' ?
    I draw a picture using illustrator scripting, but when tge scripting finished if i want to use the tool of the palette there are
    a lot of malfunction.
    best reagards
    Stefano

    Trantham wrote:
     how to clear memory from a MFC-6490CW?
    Hi,
    Welcome to HP support forums. MFC-6490CW is not from HP. The manual shows few places you may need to clear memory for fax or for normal print jobs. Please use page #48 or page #101 on the following manual to clear memory on a  Brother MFC-6490CW.
          http://download.brother.com/welcome/doc002354/cv_mfc6490w_asaoceeng_usr_a.pdf
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

Maybe you are looking for