Getting to know used memory without garbage collectable objects

Hi all,
I would like to know what is the currently used memory without garbage, so only the objects that are still referenced.
Is there a way to do that? Preferably using JConsole?
Thanks,
Kristof

That is indeed a way but the problem is that you are never sure that all garbage will get collected... (JConsole indeed has a Force GC button)
I suspect that the JVM only knows the amount of garbage when it performs a GC. And as this is an expensive operation is would not be effective from a performance point of view to constantly keep track of the amount of garbage in the heap. That is probably also the reason why there is no profiler that supports this.
It makes it difficult to get to know the actual memory gain from one implementation versus another. The most reliable way to go I think is by running the application several times, lowering the max heap each time till it fails with OutOfMemoryException.

Similar Messages

  • Getting memory dump without garbage collection

    Hi all.
    Does anyone know of a way to get a memory dump from the Sun JVM (version 1.5.0_11 for Windows) without garbage collection occurring first? I've tried the -XX:+PrintClassHistogram option, but this always seems to garbage collect before printing the histogram.
    My problem is that I see heap usage increasing very rapidly in the JVM, then garbage collection occurs and reduces memory usage back down to what it was before. However, this results in the JVM spending a large amount of time garbage collecting. I would like to be able to see the contents of the heap before GC occurs.
    These are the options I've tried so far:
    * Using -XX:+PrintClassHistogram. As mentioned above, this always garbage collects before printing the histogram.
    * Using -XX:+HeapDumpOnOutOfMemoryError. The problem is that the JVM always manages to GC before running out of memory, so never dumps the heap.
    * Using the jmap tool. Unfortunately I'm running Windows (in production), so this is not available for 1.5.
    * Using HPROF. However this seems to slow the JVM down hugely (whenever I use -agentlib:hprof=heap=sites or -agentlib:hprof=heap=dump).
    * Using the HeapViewer demo tool that comes with the JVM. This has the same effect as PrintClassHistogram and garbage collects before outputting.
    * Using JProfiler. Unfortunately it seems (with the 1.5 JVM anyway) the Concurrent Garbage Collector cannot be used in conjunction with JProfiler (I think this is a JVM TI issue?). With the Parallel GC we don't see the same problem (probably mostly because throughput is crippled with the Parallel GC).
    * Using jstat. This only gives us statistics about how much has been garabge collected, not which objects were collected.
    Has anybody got any other suggestions?
    Thanks.
    Neil.

    Hi all.
    Just an update on this -- I couldn't find any way to do this in Java 1.5 (on Windows).
    In Java 1.6 (and maybe in 1.5 on other platforms) jmap will do a heap dump without garbage collecting.
    I also came across an open source memory profiling tool called Ariadna (see http://mernst.org/ariadna/) which seems to work quite well. It was only of limited use in Java 1.5 however, since JVM TI doesn't support the concurrent garbage collector in this version.
    Hope this is helpful anyway. I'll be trying to get upgraded to 1.6 ASAP!
    Thanks.
    Neil.

  • Huge number of garbage collected objects

    We're running a system here with the java heap set to 256mb and have noticed
    that now and then, garbage collection takes a horribly long time to complete
    (in the order of minutes, rather than fractions of a minute!). Something
    like 3 million objects are being freed when the server is heavily loaded.
    Has anyone else experienced this behaviour? Has anyone tested weblogic with
    JProfiler/OptimizeIt and found any troublesome spots where many objects are
    created? One potential place where this can be happening is in the servlet
    logging. Since there is a timestamp that is a formatted date, my guess is
    that a new Date object is being created, which is very expensive and hence
    might cause many more objects that need to be garbage collected. Can any
    weblogic engineers confirm/deny this?

    Use vmstat to determine if you're swapping. sar would work too.
    Swapping is definitely dictated by the OS, but an inordinate amount of
    swapping activity just means you get to tune the hardware rather along
    with the application.
    Jason
    Original Message <<<<<<<<<<<<<<<<<<On 2/21/00, 12:45:26 PM, "Hani Suleiman"
    <[email protected]> wrote regarding Re: Huge number of
    garbage collected objects:
    Here are the results from running top on that machine:
    Memory: 512M real, 14M free, 553M swap in use, 2908M swap free
    PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
    3035 root 50 59 0 504M 334M sleep 308:42 5.13% java
    How to make sure I'm not swapping? I thought that kind of thing was dictated
    by the OS...
    Rob Woollen <[email protected]> wrote in message
    news:[email protected]..
    If GC takes on the order of minutes to run then I suspect that you
    are
    paging. How much physical memory do you have on the machine? Make sure
    that
    you are not swapping.
    -- Rob
    Hani Suleiman wrote:
    We're running a system here with the java heap set to 256mb and have
    noticed
    that now and then, garbage collection takes a horribly long time tocomplete
    (in the order of minutes, rather than fractions of a minute!).
    Something
    like 3 million objects are being freed when the server is heavilyloaded.
    Has anyone else experienced this behaviour? Has anyone tested weblogicwith
    JProfiler/OptimizeIt and found any troublesome spots where many
    objects
    are
    created? One potential place where this can be happening is in theservlet
    logging. Since there is a timestamp that is a formatted date, my guessis
    that a new Date object is being created, which is very expensive andhence
    might cause many more objects that need to be garbage collected. Can
    any
    weblogic engineers confirm/deny this?

  • High Eden Java Memory Usage/Garbage Collection

    Hi,
    I am trying to make sure that my Coldfusion Server is optomised to the max and to find out what is normal limits.
    Basically it looks like at times my servers can run slow but it is possible that this is caused by a very old bloated code base.
    Jrun can sometimes have very high CPU usage so I purchased Fusion Reactor to see what is going on under the hood.
    Here are my current Java settings (running v6u24):
    java.args=-server -Xmx4096m -Xms4096m -XX:MaxPermSize=256m -XX:PermSize=256m -Dsun.rmi.dgc.client.gcInterval=600000 -Dsun.rmi.dgc.server.gcInterval=600000 -Dsun.io.useCanonCaches=false -XX:+UseParallelGC -Xbatch ........
    With regards Memory, the only memory that seems to be running a lot of Garbage Collection is the Eden Memory Space. It climbs to nearly 1.2GB in total just under every minute at which time it looks like GC kicks in and the usage drops to about 100MB.
    Survivor memory grows to about 80-100MB over the space of 10 minutes but drops to 0 after the scheduled full GC runs. Old Gen memory fluctuates between 225MB and 350MB with small steps (~50MB) up or down when full GC runs every 10 minutes.
    I had the heap set to 2GB initally in total giving about 600MB to the Eden Space. When I looked at the graphs from Fusion Reactor I could see that there was (minor) Garbage Collection about 2-3 times a minute when the memory usage maxed out the entire 600MB which seemed a high frequency to my untrained eye. I then upped the memory to 4GB in total (~1.2GB auto given to Eden space) to see the difference and saw that GC happened 1-2 times per minute.
    Is it normal in Coldfusion that the Eden memory would grow so quickly and have garbage collection run so often? i.e do these graphs look normal?
    Also should I somehow redistribute the memory available to give the Eden memory more since it seems to be where all the action is?
    Any other advice for performance improvements would be much appreciated.
    Note: These graphs are not from a period where jrun had high CPU.
    Here are the graphs:
    PS Eden Space Graph
    PS Survivor Space Graph
    PS Old Gen Graph
    PS Perm Gen Graph
    Heap Memory Graph
    Heap/Non Heap Memory Graph
    CPU Graph
    Request Average Execution Time Graph
    Request Activity Graph
    Code Cache Graph

    Hi,
    >Is it normal in Coldfusion that the Eden memory would grow so quickly and have garbage collection run so often?
    Yes normal to garbage collect Eden often. That is a minor garbage collection.
    >Also should I somehow redistribute the memory available to give the Eden memory more since it seems to be where all the action is?
    Sometimes it is good to set Eden (Eden and its two Survivor Spaces combined make up New or Young Generation part of JVM heap) to a smaller size. I know your thinking - what make it less, but I want to make it bigger. Give less a try (sometimes less = more, bigger not = better) and monitor the situation. I like to use -Xmn switch, some sources say to use other method/s. Perhaps you could try java.args=-server -Xmx4096m -Xms4096m -Xmn172m etc. I better mention make a backup copy of jvm.config before applying changes. Having said that now you know how you can set the size to bigger if you want.
    I think the JVM is perhaps making some poor decisions with sizing the heap. With Eden growing to 1Gb then being evacuated not many objects are surviving and therefore not being promoted to Old Generation. This ultimately means the object will need to be loaded again latter to Eden rather than being referenced in the Old generation part of the heap. Adds up to poor performance.
    >Any other advice for performance improvements would be much appreciated.
    You are using Parallel garbage collector. Perhaps you could enable that to run multi-threaded reducing the time duration of the garbage collections, jvm args ...-XX:+UseParallelGC -XX:ParallelGCThreads=N etc where N = CPU cores (eg quad core = 4).
    HTH, Carl.

  • Animation gets slow when program needs a Garbage Collect.

    So nonetheless, I should probably develop a new animation algorithm, yes?
    I am looping through a seperate thread that calls the setSize() methods a bunch of times. Works really nice when memory isnt bad, but when I need to garbage collect, and apparantly java doesnt agree, it gets really slow. Later one is really able to see when a GC is actually done, and it goes back to normal.
    Here is my algorithm,
    public static boolean raisePanel(final VCMSComponentFrame p, final boolean anim)
            if (p.getState() == VCMSComponentFrame.State.RAISED ||
                p.getState() == VCMSComponentFrame.State.ANIMATING)
                return false;
            new Thread(new Runnable()
                public void run()
                    p.setState(VCMSComponentFrame.State.ANIMATING);
                    if (anim)
                        for (int i = p.getHeight(); i <= FULL_PANEL_HEIGHT; i++)
                            try
                                p.setSize(p.getWidth(), i);
                                JComponent parent = (JComponent)p.getParent();
                                int index = findIndex(p);
                                for (int j = index + 1; j < parent.getComponentCount() && j != 0; j++)
                                     parent.getComponent(j).setLocation(parent.getComponent(j).getX(), parent.getComponent(j).getY() + 1);
                                //Viewport Panel
                                parent.setSize(parent.getWidth(), parent.getHeight() + 1);
                                //Structure Frame
                                VCMSStructurePanel panel = (VCMSStructurePanel)parent.getParent();
                                parent.getParent().setSize(panel.getWidth(), panel.getHeight() + 1);
                                //Structure Siblings.
                                JPanel master = (JPanel)panel.getParent();
                                index = findStructureIndex(panel);
                                for (int j = index + 1; j < master.getComponentCount() && j != 0; j++)
                                    master.getComponent(j).setLocation(master.getComponent(j).getX(), master.getComponent(j).getY() + 1);
                                Thread.sleep(1);
                            catch (Exception ex)
                    else
                        p.setSize(p.getWidth(), FULL_PANEL_HEIGHT);
                        JPanel parent = (JPanel)p.getParent();
                        int index = findIndex(p);
                        //Viewport Panel
                        parent.setSize(parent.getWidth(), parent.getHeight() + FULL_PANEL_HEIGHT - SHORT_PANEL_HEIGHT);
                        //Structure Frame
                        VCMSStructurePanel panel = (VCMSStructurePanel)parent.getParent();
                        parent.getParent().setSize(panel.getWidth(), panel.getHeight() + FULL_PANEL_HEIGHT - SHORT_PANEL_HEIGHT);
                        //Component Siblings
                        for (int j = index + 1; j < parent.getComponentCount() && j != 0; j++)
                            parent.getComponent(j).setLocation((int)parent.getComponents()[j].getLocation().getX(), (int)parent.getComponents()[j].getLocation().getY() + FULL_PANEL_HEIGHT - SHORT_PANEL_HEIGHT);
                        //Structure Grandparent
                        JPanel master = (JPanel)panel.getParent();
                        index = findStructureIndex(panel);
                        for (int j = index + 1; j < master.getComponentCount() && j != 0; j++)
                            master.getComponent(j).setLocation((int)master.getComponent(j).getLocation().getX(), (int)master.getComponent(j).getLocation().getY() + FULL_PANEL_HEIGHT - SHORT_PANEL_HEIGHT);
                    p.setState(VCMSComponentFrame.State.RAISED);
            }).start();
            //System.gc();
            return true;
        }any help appreciated!

    sierratech wrote:
    Only a guess, but this may have something to do with Threads and Swing.
    http://java.sun.com/products/jfc/tsc/articles/threads/threads1.html.
    Many Swing updates should be called in the Event Dispatch thread, and it looks like you may be calling some of these in your new Thread.
    Try using SwingUtilities.invokeLater() and see if that helps. Alternatively, rewrite your code to remove the Thread and do everything in the event Dispatch thread using javax.swing.Timer. Again, just a guessThanks for the Idea, but this option doesnt even show the animation.
    One Idea I got from a "Swing Hacks" directory works like this:
    Remove the components for animation.
    Create an image of the components.
    Overide the Paint method.
    Animate the images via paint method.
    Remove the images.
    Add back the components.
    But I look at that and my stomach cringes.
    Any other Ideas?

  • Getting error while using TRIM method in collections

    Hi Experts,
    While using TRIM method I am getting below error. Am I doing any mistake here ?
    DB : Oracle 11g
    SQL> declare
      2
      3    type emp_tab is table of employees%rowtype index by binary_integer;
      4    l_emp_tab emp_tab;
      5
      6  begin
      7
      8   select * bulk collect into l_emp_tab from employees;
      9   l_emp_tab.trim(5);
    10   dbms_output.put_line(l_emp_tab.count);
    11
    12  end;
    13  /
    l_emp_tab.trim(5);
    ERROR at line 9:
    ORA-06550: line 9, column 2:
    PLS-00306: wrong number or types of arguments in call to 'TRIM'
    ORA-06550: line 9, column 2:
    PL/SQL: Statement ignored
    Thanks in advance for all your help.
    Cheers,
    Suri

    Gerard, and to Unkonwn epxpert ;-)
    Thanks for the reply. I am aware about extend method. But not sure about TRIM. Once again thanks for your help.
    Cheers,
    Suri

  • Array garbage collection

    I need to keep track of what objects got garbage collected in a program.
    So I made sure that the classes of interest have a 'finalize()' method that simply print out the toString() and reference of the garbage collected object (using System.identityHashCode(this)).
    This worked fine for all objects except arrays.
    I went as far as substituting my own version of java.lang.Object that has an appropriate finalize(), but still no finalize() method seem to be getting called when an array object is 'supposed' to be garbage collected (the process consumes most of the system memory...)
    Any thoughts?
    Thanks,
    Wes

    Just an idea. You can try using WeakReference. Rather than using finalize, you can use the clear method of Reference.
    Here is some pseudo code
    .. class GCWatcher{
    List wrl = ...
    public void watch(Object obj){
    wrl.add(new WatchableWeakReference(obj));
    .. class WatchableWeakReference{
    WathableWeakReference(Object obj){
    super(obj);
    public void clear(){
    wrl.remove(this);
    Object obj = get();
    print out your message
    super.clear();
    If you try it let me know if it worked.

  • Long pauses during ParNew garbage collection Please Help !

    Hi,
    We are running a server application on an large machine (~120 CPU, ~380 GB Memory).
    After running 1 or 2 hours we suddenly get exorbitant application pause times during garbage collection and a massive cpu usage from the java vm
    We are running on Java 6 (64Bit) with 6GB Heap.
    Concurrent garbage collection is turned on using the parameters:
    -XX:+UseConcMarkSweepGC
    -XX:+CMSParallelRemarkEnabled
    -XX:CMSInitiatingOccupancyFraction=80
    -XX:+DisableExplicitGC
    We turned on verbose garbage collection and are getting the following output:
    1. Normal operation:
    Application time: 217.4656792 seconds
    3180.905: [GC 3180.906: [ParNew
    Desired survivor size 20119552 bytes, new threshold 4 (max 4)
    - age   1:    2843824 bytes,    2843824 total
    - age   2:    2577128 bytes,    5420952 total
    - age   3:    5742024 bytes,   11162976 total
    - age   4:     625672 bytes,   11788648 total
    : 329531K->15764K(353920K), 0.1484379 secs] 2435799K->2122105K(3392144K), 0.1492386 secs]
    Total time for which application threads were stopped: 0.1886810 seconds
    2. The Problem:
    Application time: 2.8858445 seconds
    5008.433: [GC 5008.434: [ParNew
    Desired survivor size 20119552 bytes, new threshold 2 (max 4)
    - age   1:   15837712 bytes,   15837712 total
    - age   2:   12284416 bytes,   28122128 total
    : 348338K->39296K(353920K), 138.5317715 secs] 2487779K->2192551K(3392144K), 138.5327383 secs]
    Total time for which application threads were stopped: 138.5778558 seconds
    Application time: 2.9764564 seconds
    5149.957: [GC 5149.957: [ParNew
    Desired survivor size 20119552 bytes, new threshold 2 (max 4)
    - age   1:    9483176 bytes,    9483176 total
    - age   2:   14499344 bytes,   23982520 total
    : 353920K->39296K(353920K), 231.5110574 secs] 2507175K->2204546K(3392144K), 231.5121011 secs]
    Total time for which application threads were stopped: 231.5257754 seconds
    Application time: 2.7932907 seconds
    5384.277: [GC 5384.278: [ParNew
    Desired survivor size 20119552 bytes, new threshold 4 (max 4)
    - age   1:   10756376 bytes,   10756376 total
    - age   2:    9135888 bytes,   19892264 total
    : 353920K->28449K(353920K), 256.2065591 secs] 2519170K->2207651K(3392144K), 256.2076388 secs]
    Total time for which application threads were stopped: 256.2221463 seconds
    I can't find any significant differences in the log between fast and long running garbage collections.
    I urgently need help in solving this problem !
    What can I do ?

    After the exciting reply I did get on my question, we did some more investigations on the problem and it seems that we finally found the solution to our problem.
    The number of garbage collection threads used by the virtual machine defaults to the number of cpus of the machine.
    This is ok for small machines or machines where the main load is produced by the java application itself.
    In our environment the main load is not produced by the java application but oracle database processes.
    When java tries to do it's garbage collection using 120 threads (# CPU) on the machine which is already overloaded by non java processes, the thread synchronization seems to produce an exorbitant overhead.
    My theory is that spin locking is used on memory access, causing threads to spin while waiting for other blocking threads not getting cpu because of the heavy load on the system.
    The solution is now to limit the number of garbage collection threads.
    We did that on the first try by setting -XX:ParallelGCThreads=8
    For over one day with heavy load no long GC pauses were experienced any more.

  • Applescript: force garbage collection?

    Hello
    I am trying to call applescript functions (from my cocoa application - using NSAppleScript's -executeAndReturnError), to automate some operations in Microsoft Word.
    The problem is that after every Applescript call, the Word operates slower and slower (and i guess finally it won't respond at all). I am calling operations, like "set myvar to all words of current document whose [some conditional]" or "set myvar to all fields of current document whose [some conditional]" (which are memory consuming - on each call Word enumerates all the words of a long document, searches there some matches, etc), and i think that after each call of NSAppleScript's -executeAndReturnError, Word doesn't clean its previous "results", which slows it down with every next call. I wanted to try to do an explicit call of Applescript's garbage collector after each -executeAndReturnError from my Cocoa app, maybe that could eliminate the problem i have.
    But i didn't find any info on how to do that. Java, ActionScript - both have System.gc() functions (that launch Garbage collection if it's needed right here and right now). If theres no way to force garbage collecting in AppleScript, maybe someone knows "implicit ways", when AppleScript engine calls it? Like the next iteration of a loop, or some other conditions? Or some timespan, after passing which the GC is called?
    What could cause that slowness of Mac:Word? Is it a mistake of Microsoft, or am i forgetting to do something? If someone could advice readings about how applications usually implement Applescript interface "from the inside" (and who is responsible for cleaning the results of each call), i'd be very thankful.
    Thanks for any advice!
    George

    If you really want to see the results you should also run the finalizer
    thread on the newly garbage collected objects. It might take up to 2 GC
    cycles for the memory to be actually free for new allocation at least on
    the Sun JVMs. Maybe the new types of garbage collectors do it better or
    more optimized but anyway, the GC would first mark the objects and only
    then the finalizer will run to call the finalize method. Then next GC
    will free the memory of the finalized objects.
    HTH,
    Dejan
    Dinesh wrote:
    Hi Slava Imeshev,
    Thanks for immediate response. I agree JVM will do GC at specific interval. But,
    I have found that , there is some difference in both of them. If you invoke "Force
    Garbage Collection" explicitly, the graph will show the heap memory usage to baseline.
    Where in, if you perform System.gc(). It won't make much difference.
    Thus why, I want to know what is the code behind the "Force Garbage Collection"
    button.
    Thanks,
    -Dinesh.
    "Slava Imeshev" <[email protected]> wrote:
    "Dinesh" <[email protected]> wrote in message news:406a8df4$[email protected]..
    How can i schedule "Force Garbage Collection" to be done at every
    week or daily?.
    Can i automate this process instead of manually invoking the button?
    GC is already done by JVM automatically.
    Why would you want to "schedule" it?
    Regards,
    Slava Imeshev

  • Understanding Garbage Collection

    Garbase Collector collects any objects that the program cannot access. If an object cannot be accessed, it will be collected by the garbage collector if needed.
    Can someone explain with a simple example when an object cannot be garbase collected? preferably an example with 'String'
    thanks

    String text = "Hallo";
    //the instance "Hallo" cannot be collected here
    String message = text;
    text = null;
    //neither here;
    message = null;
    //The instance "Hallo" can be collecter here by the GBI don't think that this is the way it works. Garbage collection frees memory for use, and in this case, the variable text could still be referenced, even though it does not have a value. I might be wrong, but my guess would be that setting a variable to be null, would result in the location of memory allocated for the variable to be emptied (e.g. C-function memset). If the garbage collection would occur when the variable is set to null might cause problems, like so:
    String foo = "bar; // Create and initliaze variable
    foo = null; // Set to null, assume garbage collection
    String bar = "foor"; // Create and initialize. If this were now stored
    // in the same memory slot as foo, which would be possible due
    // to the garbage collection, problems would arise from next line
    foo = "bar"; // Now foo and bar refer to the same memory locationTherefore garbage collection occurs only when no object or class holds no reference to the variable, example:
    if(foobar) {
       String localVar = "local variable";
    // When the if-block ends, the variable localVariable is collected
    // as it no longer can be referenced.Tuomas Rinta

  • When will wls try to garbage collect ?

    The docs for the option "Low memory GC threshold" say that this is the "Threshold
    level at which WLS will try to garbage collect once the granularity report has
    been met".
    My question is: When is this condition met ? If at least once there has been a
    granularity report in the log ? Or if the server has been set to Warning state
    The problem Im trying to address is that my "Low memory GC threshold" is set to
    20% and my server has reached only 1% free memory and garbage collection did not
    run, I had to force it via console.
    Thanks in advance, Giselle

    I am wonder when the WLS activate or passivate session and how can I          control it?
              > From documents, sessionWillPassivate in HttpSessionActivationListener will
              be
              > executed when a session is about to passivate on one server (ie. WLS
              instance)
              > and the sessionDidActivate method when the same session has been activated
              on
              > a second server.
              >
              > But I have monitor the behavior for a long time by setting
              PersistentStoreType
              > to file, memory, replicated. sessionDidActivate and sessionWillPassivate
              will
              > never executed. I expected it will passivate and activate when session is
              replicated
              > between servers or persist in files. Any ideas?
              What version of WL? the interface you describe was new in Servlet 2.3, so it
              may not be implemented until 6.1 or even 7.x.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com/coherence.jsp
              Tangosol Coherence: Clustered Replicated Cache for Weblogic
              "Karen Law" <[email protected]> wrote in message
              news:3ec86188$[email protected]..
              >
              

  • Find out references to objects (garbage collection)

    Is there an easy way to find out, which references prevent the garbage collector from collecting my old objects, which I expect should be collected? Something like System.out.println(...)

    if you just want an object to be garbage collected, just
    make sure you de-reference is completely.CMueller obviously doesn't know which references prevent garbage collection so naturally he cannot set those references to null, now can he?
    o = null; // sets the value to null and drops all the referencesThat is simply not true. Removing a reference to an object doesn't affect any other references to that object.
      Object o1,o2;
      //create an object and make o1 reference it
      o1=new Object();
      //make o2 reference the same object as o1 references
      o2=o1;
      //now there are two references to the object
      //make o1 reference null
      o1=null;
      //at this point there is still one reference (o2) to
      //the object and therefore the object is NOT garbage
      //which means that it can NOT be collected by the GC- Marcus Sundman

  • API for Garbage Collection

    We are using WLS 6.1 SP3 on a Solaris machine. Is there any API we can use to
    automate garbage collection instead of manually doing through the Admin Console.
    Thanks in advance.

    I can't answer or help with all of those… Here are my thoughts… The dollar object properties and functions can be called on by script from AI, BR, ID & PS… They are NOT restricted for use in the ESTK tookit. Yeah $.writeln() would write to the console if the toolkit were open if NOT then it will probably launch it… So remove or comment these out. As you can see from $.sleep() it does what it says when run in the host app. #targetengine is exclusive to ID this app can have multi-instances ( or something like that ). The other apps have 1 engine and thats it. AI's engine is persistent so wrapping your code is good practice I do this for BR & PS too… See…
    http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/pdf/illustrator/scrip ting/readme_cs5.txt
    As for garbage collection I've never fould the need to use it… I see some like to set variables back to null but again I don't do this…
    You would have been better off asking this question in the ID scripting forum… There are several people there who are better qualified to answer some of this…

  • Use inner class as collection

    Is there a way to get toplink to use an inner class collection to house my 1:m relationship. The collection needs some attributes of the containing object.
    Can i override how collection is constructed within the java, because it seems pretty clear the workbench doesn't support this.
    thanks
    craig

    Seem like an odd thing to do. If it were a static inner class it would be possible, but an instance inner class is probably not.
    If you really need a reference to the source object from the collection object, it might be better to accomplish this through making the inner collection class an outer class, or at least static. You could then set a back reference to the source object in the source object's set method for the collection. You would need to configure the mapping to use method access, or if using value holders you could lazily set the collection back reference from your get method for the collection. You could also make special get/set methods for TopLink to use to access the collection value that convert the special collect to and from a normal collection.
    In general it might be better to put the logic specific to the owning class in the owning class instead of the collection.

  • Collection object which allows duplicate keys

    I wanted to know if there is any Collection object which allows me to store multiple values for a key.
    I have the data:
    key "a" - value "0"
    key "a" - value "1"
    key "a" - value "2"
    key "b" - value "3"
    key "b" - value "4"
    key "c" - value "5"
    Is there some collection object where I can store the above data which includes duplication of keys?

    No. The values do not need to be stored twice. What I wanted to know
    was if a key [say a in this case] can be repeated so as to store multiple
    values [0, 1, 2] against it?Well, the solution is simple then: use a Set (no matter which one)
    as the value part and collect all the (duplicate?) values in that set.
    Something like this will do:public class Multi {
       private Map map= new HashMap();
       public void put(Object key, Object value) {
          Set values= (Set)map.get(key);
          if (values == null)
             map.put(key, values= new HashSet());
          values.put(value);
       public Set get(Object key) {
          return map.get(key);
    }this was from the top of my head, typed in in a silly little reply box,
    so no warranties apply etc. ;-)
    kind regards,
    Jos

Maybe you are looking for

  • Left join and where clause with not equal ( ) returns too many rows

    Say I have something like this Table A ========= Id OrderNum Date StoreName AddressKey Table B ======== Id StreetNumber City State select a.* from [Table A] a left join [Table B] b on a.AddressKey = b.Id where a.StoreName <> 'Burger place' The troubl

  • Where is the best place to put programs to start on X/Openbox startup?

    Hi, There are several places to put programs to startup when you start X or a WM.  I'm using Openbox and presently have placed these into my .xinitrc file, but I'm not sure this really the best place.  Openbox has a autostart file, which sorta looks

  • ANY BODY TELL ME WHAT IS THE REASON FOR THIS ERROR

    hi... experts....     Iam having one screen in my previous module pool program....and now as per my requirement i added on e new field... for that...   1. i declared one variable in top include...   2. cretaed one more new block with help of box in l

  • Right click to open link in new tab sometimes missing

    example: http://en.wikipedia.org/wiki/StannardRockLight In Safari 3, I could right click on the image to the right and get the contextual menu item "Open link in new tab." In Safari 4, it's missing. However, if I hold down the command key and click,

  • What am i supposed to do with this?

    I cannot believe how rapidly Apple has declined since Steve Jobs.   About a year age a bought a mini mac. what a great tool. Very fast, ran all my graphic programs and was able to burn projects to DVD.   So A few weeks ago bought a new mac mini and i