Mmeory leak | gar4bage collection

Hi all,
I am facing memory leak issue with my web application.When i undeploy my app .. some classes (objects) are not getting GC'ed ... when i used JProfile and did Path to GC root most of them pointed to to class loader as there path to gc.
lets say my application has class A and Class B and class C and so on...
when i did path to gc on class C it showed it as class A
when i did path to GC on class A it showed path to class loaded
when i did path to GC on class loader it showed lot spring/hibernate classes please help...

This sounds like a Spring/Hibernate issue.
I assume you tried forcing a full GC.

Similar Messages

  • External speakers "pop" when mac mini is asleep

    I've got some Creative 5.1 speakers plugged into my mini, only using the left and right speakers. When the computer is asleep, the speakers make a popping noise that lasts through the computer waking up and until I change the volume on the computer. As soon as I change the volume, the popping stops until the next time the computer goes to sleep -- then it starts back up again.
    Any clues on how to fix this? Thanks!

    The problem is in the design of the speakers.
    The amplifier circuit works any time the speakers are on. When there is no music, it amplifies the noise that is present. Some circuits have leaks and collect electricity until it builds up. Once it reaches a high enough level, the capacitor discharges and you hear a pop.
    The mini should send no signal when sleeping - you can check this by disconnecting the speaker - but leave it sitting in the back of the mini. All of the cords at the back of the computer emit electricity - expecially the power cord. Having the speaker cable next to the other cables - it acts like an antenna and picks up noise. You might have luck shielding your speaker cable if this really annoys you. Otherwise, you need to get a better amplifier in your speakers to filter this noise or reduce the leakage current.

  • Memory leak in java / forcing garbage collection for unused resource?

    Is there any possibility in big programs if not designed properly for leakage of memory?
    If say i forget to force garbage collection of unused resouces what will happen?
    Even if i am forcing garbage collection how much assurity can be given to do so?
    I need answers w.r.t typical programming examples if someone can provide i will be happy.
    Or any useful link.
    Thanks
    Vijendra

    Memory leaks are usually much related with C/C++ programming since in that language you have direct access to memory using pointers.
    Now, in Java you do not have access to pointers, however you could still tie up your objects in a way that the garbage collection can not remove them.
    Basically, the grabage collection will search all the object implementation, and see if they are referenced or not. If not it will free that memory. However if you, somehow in you code allow a reference to your object then the garbage collection will not displose of that object.
    An example I can think of is when developing web applications. For example storing objects in the session will mean that you will have a reference to the object from the session, therefore the garbage collection will not free up the meomry taken by those objects untill the session has expired.
    That is how I know it... at least that is how they tought it to me!
    regards,
    sim085

  • Memory Leak Detector data collection timing

    Hello,
    I am Yoshizo Aori working at HP Japan.
    I would like to know timing of data collection for
    updating object type byte size increase rate.
    Data collection at garbage collection or any other timing?
    Is it possible to change the timing of the data collection?

    Yoshizo,
    The actual "Growth(bytes/sec)" column is updated along with the other columns at every normal GC and currently, independent of any GC, also every ten seconds. This interval is not yet configurable. (While the trend analysis is running, it is possible to manually press "Refresh" to get shorter time between updates.)
    However, the Growth column is primarily calculated using historic data collected during normal GCs while the trend analysis is active. Only if the historic data shows a difference in heap usage, the current value shown in the "Size (KB)" column is taken into account. The effect is that the "Refresh" button only updates Growth column rows that have had non-zero values.
    This also means that if an application leaks slowly and doesn't generate enough garbage to trigger a GC in the near future, you may not notice it by looking at the Growth column. If so, it is possible to trigger a GC, and thus a possible collection of historic data, by selecting "Garbage Collect" from the Action menu.
    Remember though, since the Growth column represents the growth rate over the entire time that the trend analysis has been running, you may want to avoid very long running analyses. In fact, after a while, historic data is not collected every GC but more and more seldom.

  • Huge memory leaks in using PL/SQL tables and collections

    I have faced a very interesting problem recently.
    I use PL/SQL tables ( Type TTab is table of ... index by binary_integer; ) and collections ( Type TTab is table of ...; ) in my packages very widely. And have noticed avery strange thing Oracle does. It seems to me that there are memory leaks in PGA when I use PL/SQL tables or collections. Let me a little example.
    CREATE OR REPLACE PACKAGE rds_mdt_test IS
    TYPE TNumberList IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
    PROCEDURE test_plsql_table(cnt INTEGER);
    END rds_mdt_test;
    CREATE OR REPLACE PACKAGE BODY rds_mdt_test IS
    PROCEDURE test_plsql_table(cnt INTEGER) IS
    x TNumberList;
    BEGIN
    FOR indx IN 1 .. cnt LOOP
    x(indx) := indx;
    END LOOP;
    END;
    END rds_mdt_test;
    I run the following test code:
    BEGIN
    rds_mdt_test.test_plsql_table (1000000);
    END;
    and see that my session uses about 40M in PGA.
    If I repeat this example in the same session creating the PL/SQL table of smaller size, for instance:
    BEGIN
    rds_mdt_test.test_plsql_table (1);
    END;
    I see again that the size of used memory in PGA by my session was not decreased and still be the same.
    The same result I get if I use not PL/SQL tables, but collections or varrays.
    I have tried some techniques to make Oracle to free the memory, for instance to rewrite my procedure in the following ways:
    PROCEDURE test_plsql_table(cnt INTEGER) IS
    x TNumberList;
    BEGIN
    FOR indx IN 1 .. cnt LOOP
    x(indx) := indx;
    END LOOP;
    x.DELETE;
    END;
    or
    PROCEDURE test_plsql_table(cnt INTEGER) IS
    x TNumberList;
    BEGIN
    FOR indx IN 1 .. cnt LOOP
    x(indx) := indx;
    END LOOP;
    FOR indx in 1 .. cnt LOOP
    x.DELETE(indx);
    END LOOP;
    END;
    or
    PROCEDURE test_plsql_table(cnt INTEGER) IS
    x TNumberList;
    empty TNumberList;
    BEGIN
    FOR indx IN 1 .. cnt LOOP
    x(indx) := indx;
    END LOOP;
    x := empty;
    END;
    and so on, but result was the same.
    This is a huge problem for me as I have to manipulate collections and PL/SQL tables of very big size (from dozens of thousand of rows to millions or rows) and just a few sessions running my procedure may cause server's fall due to memory lack.
    I can not understand what Oracle reseveres such much memory for (I use local variables) -- is it a bug or a feature?
    I will be appreciated for any help.
    I use Oracle9.2.0.1.0 server under Windows2000.
    Thank you in advance.
    Dmitriy.

    Thank you, William!
    Your advice about using DBMS_SESSION.FREE_UNUSED_USER_MEMORY was very useful. Indeed it is the tool I was looking for.
    Now I write my code like this
    declare
    type TTab is table of ... index binary_integer;
    res TTab;
    empty_tab TTab;
    begin
    res(1) := ...;
    res := empty_tab;
    DBMS_SESSION.FREE_UNUSED_USER_MEMORY;
    end;
    I use construction "res := empty_tab;" to mark all memory allocated to PL/SQL table as unused according to Tom Kyte's advices. And I could live a hapy life if everything were so easy. Unfortunately, some tests I have done showed that there are some troubles in cleaning complex nested PL/SQL tables indexed by VARCHAR2 which I use in my current project.
    Let me another example.
    CREATE OR REPLACE PACKAGE rds_mdt_test IS
    TYPE TTab0 IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
    TYPE TRec1 IS RECORD(
    NAME VARCHAR2(4000),
    rows TTab0);
    TYPE TTab1 IS TABLE OF TRec1 INDEX BY BINARY_INTEGER;
    TYPE TRec2 IS RECORD(
    NAME VARCHAR2(4000),
    rows TTab1);
    TYPE TTab2 IS TABLE OF TRec2 INDEX BY BINARY_INTEGER;
    TYPE TStrTab IS TABLE OF NUMBER INDEX BY VARCHAR2(256);
    PROCEDURE test_plsql_table(cnt INTEGER);
    PROCEDURE test_str_tab(cnt INTEGER);
    x TTab2;
    empty_tab2 TTab2;
    empty_tab1 TTab1;
    empty_tab0 TTab0;
    str_tab TStrTab;
    empty_str_tab TStrTab;
    END rds_mdt_test;
    CREATE OR REPLACE PACKAGE BODY rds_mdt_test IS
    PROCEDURE test_plsql_table(cnt INTEGER) IS
    BEGIN
    FOR indx1 IN 1 .. cnt LOOP
    FOR indx2 IN 1 .. cnt LOOP
    FOR indx3 IN 1 .. cnt LOOP
    x(indx1) .rows(indx2) .rows(indx3) := indx1;
    END LOOP;
    END LOOP;
    END LOOP;
    x := empty_tab2;
    dbms_session.free_unused_user_memory;
    END;
    PROCEDURE test_str_tab(cnt INTEGER) IS
    BEGIN
    FOR indx IN 1 .. cnt LOOP
    str_tab(indx) := indx;
    END LOOP;
    str_tab := empty_str_tab;
    dbms_session.free_unused_user_memory;
    END;
    END rds_mdt_test;
    1. Running the script
    BEGIN
    rds_mdt_test.test_plsql_table ( 100 );
    END;
    I see that usage of PGA memory in my session is close to zero. So, I can judge that nested PL/SQL table indexed by BINARY_INTEGER and the memory allocated to it were cleaned successfully.
    2. Running the script
    BEGIN
    rds_mdt_test.test_str_tab ( 1000000 );
    END;
    I can see that plain PL/SQL table indexed by VARCHAR2 and memory allocated to it were cleaned also.
    3. Changing the package's type
    TYPE TTab2 IS TABLE OF TRec2 INDEX BY VARCHAR2(256);
    and running the script
    BEGIN
    rds_mdt_test.test_plsql_table ( 100 );
    END;
    I see that my session uses about 62M in PGA. If I run this script twice, the memory usage is doubled and so on.
    The same result I get if I rewrite not highest, but middle PL/SQL type:
    TYPE TTab1 IS TABLE OF TRec1 INDEX BY VARCHAR2(256);
    And only if I change the third, most nested type:
    TYPE TTab0 IS TABLE OF NUMBER INDEX BY VARCHAR2(256);
    I get the desired result -- all memory was returned to OS.
    So, as far as I can judge, in some cases Oracle does not clean complex PL/SQL tables indexed by VARCHAR2.
    Is it true or not? Perhaps there are some features in using such way indexed tables?

  • Memory Leak / Strange Garbage Collection

    Help!
    We are having strange problems that appear to be related to a memory leak. The
    strange part is that even if we don't hit the site, it appears to leak. Can someone
    please explain the output below: Notice how freespace is decreasing, even with
    no direct site activity:
    [GC 48857K->35514K(130560K), 0.0136978 secs]
    [GC 49018K->35548K(130560K), 0.0144821 secs]
    [GC 49052K->35550K(130560K), 0.0128796 secs]
    [GC 49054K->35549K(130560K), 0.0121789 secs]
    [GC 49053K->35547K(130560K), 0.0126394 secs]
    [GC 49051K->35582K(130560K), 0.0161642 secs]
    [GC 49086K->35770K(130560K), 0.0209171 secs]
    [GC 49247K->36005K(130560K), 0.0188181 secs]
    [GC 49509K->36198K(130560K), 0.0129967 secs]
    etc...
    If I understand the numbers correctly, we have less and less free space available.
    If anyone has any insights into this it will be greatly appreciated. We have problems
    moving into production.
    Our environment: Solaris 8, Jdk1.3.1, WL 5.1
    Chris

    Chris - turn off verbose GC and and don't worry about it.
    Visit java.sun.com and read all about Java and Garbage Collection and JVMs.
    Weblogic does 'stuff' all on it's own even when it is not being accessed - just
    like your refrigerator runs when are on vacation - (please tell me you don't worry
    about that too). Objects get created and deleted. There is no pressing need for
    the garbage collector to recover every scrap of unused memory - so it doesn't.
    When the JVM does desperately need memory, it will run a Full GC and recover (almost)
    all of that.
    Then again it's nice to see someone who is curious about how the darn thing works.
    :) Mike
    "Chris" <[email protected]> wrote:
    >
    Thanks for the information. I guess I didn't understand it properly.
    Is there a
    reason why the numbers keep increasing, even with no site activity? It
    looks like
    there is less and less free space every few minutes....? After running
    the whole
    night after posting the original message, the numbers now look like:
    [GC 55586K->42276K(130560K), 0.0136978 secs]
    ie. Just keeps going up. Why does it increase? Thanks for any explanations!
    Dimitri Rakitine <[email protected]> wrote:
    You are not 'leaking memory' (hopefully!) - these are minor collections
    (quickly
    copying objects which lived long enough to the old generation portion
    of the heap
    and reclaiming space used by objects which died young) - wait until
    major collection
    (when it says [Full GC ...]).
    Chris <[email protected]> wrote:
    Help!
    We are having strange problems that appear to be related to a memoryleak. The
    strange part is that even if we don't hit the site, it appears to
    leak.
    Can someone
    please explain the output below: Notice how freespace is decreasing,even with
    no direct site activity:
    [GC 48857K->35514K(130560K), 0.0136978 secs]
    [GC 49018K->35548K(130560K), 0.0144821 secs]
    [GC 49052K->35550K(130560K), 0.0128796 secs]
    [GC 49054K->35549K(130560K), 0.0121789 secs]
    [GC 49053K->35547K(130560K), 0.0126394 secs]
    [GC 49051K->35582K(130560K), 0.0161642 secs]
    [GC 49086K->35770K(130560K), 0.0209171 secs]
    [GC 49247K->36005K(130560K), 0.0188181 secs]
    [GC 49509K->36198K(130560K), 0.0129967 secs]
    etc...
    If I understand the numbers correctly, we have less and less free
    space
    available.
    If anyone has any insights into this it will be greatly appreciated.We have problems
    moving into production.
    Our environment: Solaris 8, Jdk1.3.1, WL 5.1
    Chris--
    Dimitri

  • 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.

  • ITunes Artwork Screen Saver Not Working. Empty black screen. Garbage collection, memory leak issue? ... malloc: auto malloc[]: attempted to remove unregistered weak referrer 0x ...

    Hey Smart Apples,
    My iTunes Artwork screen saver is not working. After reboot, then selecting iTunes Artwork in System Preferences, just a black screen appears in the preview, as well as when pressing Test, and when allowing the screen saver to start on it's own. The error message in Console says...
    11-10-13 2:13:18.304 AM [0x0-0x4f04f].com.apple.systempreferences: System Preferences(540,0x7fff77286960) malloc: auto malloc[540]: attempted to remove unregistered weak referrer 0x102021a10
    11-10-13 2:13:18.305 AM [0x0-0x4f04f].com.apple.systempreferences: System Preferences(540,0x7fff77286960) malloc: auto malloc[540]: attempted to remove unregistered weak referrer 0x102021a60
    also...
    11-10-13 3:31:38.722 AM [0x0-0x65065].com.apple.ScreenSaver.Engine: ScreenSaverEngine(727,0x7fff77286960) malloc: auto malloc[727]: attempted to remove unregistered weak referrer 0x109eac410
    11-10-13 3:31:38.723 AM [0x0-0x65065].com.apple.ScreenSaver.Engine: ScreenSaverEngine(727,0x7fff77286960) malloc: auto malloc[727]: attempted to remove unregistered weak referrer 0x109eac460
    The memory address location at the end of each line is different everytime I preview the screen saver.
    I've tried...
        deleting ~/Library/Preferences/ByHost/com.apple.screensaver.* files
        making sure each album has a cover in iTunes
        running Get Album Artwork in iTunes
        recreating symbolic link ~/Music/iTunes/iTunes Music -> ~/Public/iTunes Music/
    ... but doesn't help.
    All other screen savers work... my usual is Flurry, and it works too, but gives invalid framebuffer operation under Console.
    Nothing running/checked under Sharing.
    Activity Monitor:
    0     kernel_task    root    1.5    66    355.9 MB    Intel (64 bit)    124.7 MB   
    1     launchd    root    0.0    3    1.6 MB    Intel (64 bit)    38.7 MB   
    41     mds    root    0.0    4    104.4 MB    Intel (64 bit)    260.8 MB   
    93     WindowServer    _windowserver    9.0    5    81.5 MB    Intel (64 bit)    31.6 MB   
    26     coreservicesd    root    0.0    4    26.8 MB    Intel (64 bit)    37.3 MB   
    44     loginwindow    [userhandle]    0.0    2    22.7 MB    Intel (64 bit)    19.2 MB   
    152     com.apple.dock.extra    [userhandle]    0.0    2    12.0 MB    Intel (64 bit)    32.2 MB   
    19     opendirectoryd    root    0.0    8    8.3 MB    Intel (64 bit)    25.3 MB   
    192     applepushserviced    root    0.0    4    7.1 MB    Intel (64 bit)    29.9 MB   
    11     UserEventAgent    root    0.0    4    6.8 MB    Intel (64 bit)    41.7 MB   
    23     securityd    root    0.0    4    6.6 MB    Intel (64 bit)    32.9 MB   
    57     socketfilterfw    root    0.0    3    6.3 MB    Intel (64 bit)    31.7 MB   
    60     lsd    root    0.0    3    5.9 MB    Intel    32.8 MB   
    15     fseventsd    root    0.0    29    5.3 MB    Intel (64 bit)    45.9 MB   
    14     configd    root    0.0    7    5.2 MB    Intel (64 bit)    27.1 MB   
    144     coreaudiod    _coreaudiod    0.0    3    5.2 MB    Intel (64 bit)    32.6 MB   
    239     aosnotifyd    root    0.0    2    4.6 MB    Intel (64 bit)    28.2 MB   
    552     VDCAssistant    root    0.0    4    4.6 MB    Intel (64 bit)    30.2 MB   
    607     xpchelper    [userhandle]    0.0    2    4.4 MB    Intel (64 bit)    29.6 MB   
    37     revisiond    root    0.0    4    3.5 MB    Intel (64 bit)    27.9 MB   
    10     kextd    root    0.0    3    3.5 MB    Intel (64 bit)    15.0 MB   
    42     mDNSResponder    _mdnsresponder    0.0    3    3.4 MB    Intel (64 bit)    40.9 MB   
    30     warmd    nobody    0.0    3    3.2 MB    Intel (64 bit)    23.2 MB   
    71     netbiosd    _netbios    0.0    2    2.9 MB    Intel (64 bit)    40.8 MB   
    594     cupsd    root    0.0    3    2.9 MB    Intel (64 bit)    41.4 MB   
    600     taskgated    root    0.0    3    2.7 MB    Intel (64 bit)    28.6 MB   
    31     usbmuxd    _usbmuxd    0.0    3    2.6 MB    Intel (64 bit)    40.6 MB   
    591     writeconfig    root    0.0    2    2.5 MB    Intel (64 bit)    29.3 MB   
    33     special_file_handler    root    0.0    3    2.3 MB    Intel (64 bit)    21.1 MB   
    28     ntpd    root    0.0    1    2.0 MB    Intel (64 bit)    18.6 MB   
    204     filecoordinationd    root    0.0    2    1.9 MB    Intel (64 bit)    21.7 MB   
    20     powerd    root    0.0    3    1.8 MB    Intel (64 bit)    29.6 MB   
    48     hidd    root    1.0    5    1.8 MB    Intel (64 bit)    22.7 MB   
    55     autofsd    root    0.0    2    1.7 MB    Intel (64 bit)    21.6 MB   
    106     logind    root    0.0    2    1.6 MB    Intel (64 bit)    21.1 MB   
    94     CVMServer    root    0.0    1    1.6 MB    Intel (64 bit)    21.8 MB   
    17     distnoted    root    0.0    2    1.6 MB    Intel (64 bit)    21.1 MB   
    13     diskarbitrationd    root    0.0    3    1.6 MB    Intel (64 bit)    21.7 MB   
    608     activitymonitord    root    2.5    1    1.4 MB    Intel (64 bit)    28.6 MB   
    109     launchd    [userhandle]    0.0    2    1.3 MB    Intel (64 bit)    38.1 MB   
    546     Firefox    [userhandle]    1.5    21    389.6 MB    Intel (64 bit)    321.6 MB   
    551     Firefox Plugin Process (Shockwave Flash)    [userhandle]    0.0    5    22.4 MB    Intel (64 bit)    37.1 MB   
    540     System Preferences    [userhandle]    2.1    8    82.5 MB    Intel (64 bit)    321.8 MB   
    143     Finder    [userhandle]    0.2    8    61.8 MB    Intel (64 bit)    171.6 MB   
    328     mdworker    [userhandle]    0.0    4    48.0 MB    Intel (64 bit)    69.6 MB   
    140     Dock    [userhandle]    0.0    3    40.6 MB    Intel (64 bit)    35.5 MB   
    520     Console    [userhandle]    0.0    3    35.2 MB    Intel (64 bit)    41.5 MB   
    605     Activity Monitor    [userhandle]    12.1    3    23.6 MB    Intel (64 bit)    35.2 MB   
    142     SystemUIServer    [userhandle]    0.0    2    21.3 MB    Intel (64 bit)    50.5 MB   
    389     GrowlHelperApp    [userhandle]    0.0    3    18.2 MB    Intel (64 bit)    37.5 MB   
    207     AppleSpell.service    [userhandle]    0.0    2    13.0 MB    Intel (64 bit)    36.6 MB   
    155     ubd    [userhandle]    0.0    7    11.2 MB    Intel (64 bit)    26.8 MB   
    593     Image Capture Extension    [userhandle]    0.0    2    10.8 MB    Intel (64 bit)    33.0 MB   
    150     fontd    [userhandle]    0.0    2    10.6 MB    Intel (64 bit)    28.4 MB   
    166     Little Snitch UIAgent    [userhandle]    0.0    3    9.0 MB    Intel    30.8 MB   
    167     Little Snitch Network Monitor    [userhandle]    2.3    4    8.6 MB    Intel    31.9 MB   
    131     UserEventAgent    [userhandle]    0.0    3    8.4 MB    Intel (64 bit)    41.3 MB   
    141     talagent    [userhandle]    0.0    2    7.0 MB    Intel (64 bit)    30.5 MB   
    160     imagent    [userhandle]    0.0    4    5.4 MB    Intel (64 bit)    15.5 MB   
    290     iTunes Helper    [userhandle]    0.0    3    3.6 MB    Intel (64 bit)    29.7 MB   
    115     distnoted    [userhandle]    0.0    4    3.3 MB    Intel (64 bit)    25.3 MB   
    559     lsboxd    [userhandle]    0.0    2    2.7 MB    Intel (64 bit)    30.8 MB   
    304     cookied    [userhandle]    0.0    2    1.9 MB    Intel (64 bit)    30.3 MB   
    165     AirPort Base Station Agent    [userhandle]    0.0    4    1.9 MB    Intel (64 bit)    22.8 MB   
    154     warmd_agent    [userhandle]    0.0    2    1.7 MB    Intel (64 bit)    22.8 MB   
    146     pboard    [userhandle]    0.0    1    1.5 MB    Intel (64 bit)    19.7 MB   
    35     stackshot    root    0.0    3    1.1 MB    Intel (64 bit)    21.6 MB   
    12     notifyd    root    0.0    3    1.0 MB    Intel (64 bit)    25.3 MB   
    46     KernelEventAgent    root    0.0    3    988 KB    Intel (64 bit)    29.2 MB   
    584     launchd    _spotlight    0.0    2    784 KB    Intel (64 bit)    38.1 MB   
    586     mdworker    _spotlight    0.0    3    5.6 MB    Intel (64 bit)    22.9 MB   
    587     distnoted    _spotlight    0.0    2    1,008 KB    Intel (64 bit)    30.3 MB   
    16     syslogd    root    0.0    4    764 KB    Intel (64 bit)    39.2 MB   
    50     dynamic_pager    root    0.0    1    740 KB    Intel (64 bit)    9.4 MB   
    173     appleprofilepolicyd    root    0.0    1    724 KB    Intel (64 bit)    9.4 MB    
    59     memcached    daemon    0.0    6    640 KB    Intel (64 bit)    29.0 MB   
    Does anyone have a solution?
    Environment: Mac OS X (10.7.2), Macbook Pro (late 2008)

    So it turned out that the cause of the problem wasn't as complicated as I thought...
    I had a few songs that were not added to the iTunes library, instead referenced from other locations on my hard drive.
    Specifically, if you bring up the Get Info window of a song, under Summary > Where, it may show a different path than your usual iTunes Media folder location, set under Preferences.
    E.g. Where: ~/Desktop/downloaded_song.mp3
    I guess, this happens when you drag a song into your iTunes instead of adding it to the library, and apparently, causes problems with the Artwork Screen Saver.
    Solution:
    To correct it,
    For those songs, go to File > Add to Library...
    Then find and select the song file.
    That's all I had to do to get the screen saver working... All your songs have to be added to your iTunes Library.
    I think my brother was messing around with my playlist... I hope Apple nails a better way to lock-unlock/secure OS X soon (proximity sensor, biometric 3D face recognition, unique voice recognition, soul recognition, etc.).
    That malloc error message still shows up; that must be an unrelated issue with the screen saver.
    I hope this helps out all those suffering through the same issue with their iTunes Artwork Screen Saver.

  • Creative Cloud for Mac (latest version) has a "leak" error

    The latest download of the Mac Creative Cloud app has a bug.  After receiving the latest CC (today) my system console continues to inform me of a "leak error" at the rate of abot four per minute.  For example: "10/6/14 5:18:09.479 PM com.adobe.AdobeCreativeCloud: objc[190]: Object 0x699153a0 of class __NSCFData autoreleased with no pool in place - just leaking - break on objc_autoreleaseNoPool() to debug"
    Any ideas on a fix?
    Thanks,
    Jim

    Hi Jim,
    Kindly collect the logs using the below mentioned link and send it over to the email address mentioned in Private Message so that we can try to help you appropriately.
    Log collector: Log Collector Tool
    Thanks,
    Atul Saini

  • Memory leak in JSpinner implementation (maybe others?)

    Hi,
    I am developing an application using Java and Swing, and have run into some problems with memory leaks. After examining the source code and making an example program (provided below), I can only come to the conclusion that there is a bug in the implementation of JSpinner in Sun Java 1.6.0_03.
    If one uses a custom model with the JSpinner, it attaches itself as a listener to the model. However, it never removes the listening connection, even if the model is changed. This causes the JSpinner to be kept in memory as long as the model exists, even if all other references to the component have been removed.
    An example program is available at http://eddie.dy.fi/~sampo/ModelTest.java . It is a simple swing program that has the JSpinner and two buttons, the first of which writes to stdout the listeners of the original model and the second changes the spinner model to a newly-created model. A sample output is below:
    Running on 1.6.0_03 from Sun Microsystems Inc.
    Listeners before connecting to JSpinner:
      Model value is 0, 0 listeners connected:
    Listeners after connecting to JSpinner:
      Model value is 0, 2 listeners connected:
      1: interface javax.swing.event.ChangeListener
      2: javax.swing.JSpinner$ModelListener@9971ad
    Listeners now:
      Model value is 8, 2 listeners connected:
      1: interface javax.swing.event.ChangeListener
      2: javax.swing.JSpinner$ModelListener@9971ad
    Changing spinner model.
    Listeners now:
      Model value is 8, 2 listeners connected:
      1: interface javax.swing.event.ChangeListener
      2: javax.swing.JSpinner$ModelListener@9971adThis shows that even though the model of the JSpinner has been changed, it still listens to the original model. I haven't looked at other components whether they retain connections to the old models as well.
    In my case, I have an adaptor-model which provides a SpinnerModel interface to the actual data. The adaptor is implemented so that it listens to the underlying model only when it itself is being listened to. If the JComponents using the model were to remove the listening connections, it, too, would be automatically garbage-collected. However, since JSpinner does not remove the connections, the adaptor also continues to listen to the underlying model, and neither can be garbage-collected.
    All in all, the listener-connections seem to be a very easy place to make memory leaks in Java and especially in Swing. However, as I see it, it would be a simple matter to make everything work automatically with one simple rule: Listen to the models only when necessary.
    If a component is hidden (or alternatively has no contact to a parent JFrame or equivalent), it does not need to listen to the model and should remove the connections. When the component is again set visible (or connected to a frame) it can re-add the connections and re-read the current model values just as it does when initializing the component. Similarly, any adaptor-models should listen to the underlying model only when it itself is being listened to.
    If the components were implemented in this way, one could simply remove a component from the frame and throw it away, and automatically any listener-connections will be removed and it can be garbage-collected. Similarly any adaptor-models are collected when they are no longer in use.
    Changing the API implementation in this way would not require any changes to applications, as the only thing that changes are the listener-connections. Currently used separate connection-removing methods should still work, though they would be unnecessary any more. The API would look exactly the same from the view of an application programmer, only that she would not need to care about remnant listening connections. (As far as I can tell, the current API specification would allow the API to be implemented as described above, but it should of course require it to be implemented in such a way.)
    Am I missing something, or is there some valid reason why the API is not implemented like this?
    PS. I'm new to these forums, so if there is a better place to post these reports, please tell me. Thanks.

    Another cognition: It's the following code, that causes the memory to be accumulated:
    obj = m_orb.resolve_initial_references("NameService");
    ctx = NamingContextExtHelper.narrow(obj);For the first 4 calls to this code the memory usage of the nameservice is unchanged. From the 5th to the 8th call, it's increased by approx. 10KB per call. And thenceforward (beginning with the 9th call) it's increasing by approx. 10MB.
    What's going wrong here?

  • Memory increases, GC does not collect.

    I am developing an AIR application using FlexBuilder (FlashBuilder) 4.0.1 (Standard) in an Eclipse plugin environment, on the Windows 7 64-bit platform.
    My application is intended to run full-screen, on a touchscreen device, as an application for small children (pre-k).
    The general operation is to present a series of scenarios, one by one, from a collection of separately developed swf files. (each swf file is a scenario).  The child responds to the swf file, the swf file sends an event to the player, which performs an unloadAndStop() on the Loader object that loaded the swf.  Then the next swf is loaded.
    The problem we are seeing is that each swf file adds about 15-25 MB to the Workingset Private allocation of the AIR application (or the ADL.EXE runtime).  Very little of this RAM is returned.  After about 140 of these scenarios, the AIR runtime consumes about 1.6 GB of RAM.  This, in itself, is not the problem - we could buy more RAM.
    The problem is that the Loader crashes here, and takes the whole AIR runtime with it.
    We also have a few "special purpose" swf files which are basically just wrappers around a s:VideoPlayer control, that plays a bindable file - .flv video, and the complete event fires the event that tells the AIR player to unloadAndStop the swf.
    Since the video player took no manual intervention to test, I built a set of these to simulate a high load, and found that:
    The .flv files are opened, but they are never closed. Since the s:VideoPlayer control is an MXML construct, there is no explicit way I can see to tell it to close the dang file when it's done.  (it's not documented, anyway).
    At exactly 32 video-swf items, the videos will continue to play, but there is no more audio.
    At exactly 73 video-swf items, (seemingly regardless of the SIZE of the .flv file I select), the 73rd item crashes the Loader (and AIR player).
    I supply unloadAndStop() with the (true) parameter.  I follow it with a System.gc().
    I explicitly remove ALL of my listeners. (in the AIR player application - I assume no control over items within the swf items that I am playing, since we assume we eventually may end up playing 3rd-party developed items; so we rely only on the return of a completion event, and a data structure).
    I explicitly close() ALL of my audio streams. (at the AIR player level - not in the swfs.)
    I explicitly stop() ALL of my timers.
    My loader is instantiated in an element called "myLoaderContainer" - and after I receive my completion event, I do a myLoaderContainer.removeAllElements();
    I have tried both the System.gc() call and the "unsupported"  LocalConnection().connect('foo') call.  both of these have zero effect. (in other words, I think there is probably no garbage to collect).
    Still, I find it strange that nowhere, is it written, any kind of hint about how often garbage collection will do it's thing, and having graphed the flash.system.System.privateMemory; usage against all of my functions, and narrowed it down to my loader, and seeing that this allocation is never reclaimed, even on loader.unloadAndStop(true); - I wonder exactly what is the (true) parameter for, in that method?
    I don't know what else I am supposed to do to force my Loader to *actually* unloadAndStop().
    One would think that unloadAndStop() would not mean: "cease all functioning, but continue to occupy memory until the parent application chokes on it's own heap."

    I recompiled the memory leaking program using AIR 3.0 and the leak remains. However my previous description of the problem was incorrect. It's not a bytearray I'm using. It's just a normal  array, of 9 floats. Now this array is is being updated in an event, on an indefinite basis (from hardware data provided by a separate process running as a socket server). The updating array  is a class scope array. On each update the index restarts to zero (ie. it's not a ballooning array). However, each item of that updating array is then being redispatched in the context of another socket event (request events by another process), using socket.writeDouble() - also on an indefinite basis.
    So while the array is being written in the context of one event, it's simultaneously being read in the context of another uncorrelated event.
    My only theory is that the speed at which the array is being written/read (since only nine floats) is causing some overflow in the number of temporary arrays that might be generated to accomodate such abuse. And that maybe such temps are becomining lost to the gc - that pehaps the gc can't keep up with the abuse. But that's just me speculating what theorys I could test for workarounds.
    In native code I'd use various thread controls (mutexes etc),  to control read/writes on the async socket events, but here I'm somewhat at a loss as to how to otherwise control the data flow. Indeed I ended up rewriting the program  in native code (c++) to get around the memory leak.
    Carl

  • Memory leak using xslprocessor.valueof in 11.1.0.6.0 - 64bit ??

    My company has made the decision to do all of our internal inter-system communication using XML. Often we may need to transfer thousands of records from one system to another and due to this (and the 32K limit in prior versions) we're implementing it in 11g. Currently we have Oracle 11g Enterprise Edition Release 11.1.0.6.0 on 64 bit Linux.
    This is a completely network/memory setup - the XML data comes in using UTL_HTTP and is stored in a CLOB in memory and then converted to a DOMDocument variable and finally the relevant data is extracted using xslprocessor.valueof calls.
    While this is working fine for smaller datasets, I've discovered that repeated calls with very large documents cause the xslprocessor to run out of memory with the following message:
    ERROR at line 1:
    ORA-04030: out of process memory when trying to allocate 21256 bytes
    (qmxdContextEnc,)
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 1010
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 1036
    ORA-06512: at "XDB.DBMS_XSLPROCESSOR", line 1044
    ORA-06512: at "SCOTT.UTL_INTERFACE_PKG", line 206
    ORA-06512: at line 28
    Elapsed: 00:03:32.45
    SQL>
    From further testing, it appears that the failure occurs after approximately 161,500 calls to xslprocessor.valueof however I'm sure this is dependent on the amount of server memory available (6 GB in my case).
    I expect that we will try and log a TAR on this, but my DBA is on vacation right now. Has anyone else tried calling the xslprocessor 200,000 times in a single session?
    I've tried to make my test code as simple as possible in order to track down the problem. This first block simply iterates through all of our offices asking for all of the employees at that office (there are 140 offices in the table).
    DECLARE
    CURSOR c_offices IS
    SELECT office_id
    FROM offices
    ORDER BY office_id;
    r_offices C_OFFICES%ROWTYPE;
    BEGIN
    OPEN c_offices;
    LOOP
    FETCH c_offices INTO r_offices;
    EXIT WHEN c_offices%NOTFOUND;
    utl_interface_pkg.get_employees(r_offices.office_id);
    END LOOP;
    CLOSE c_offices;
    END;
    Normally I'd be returning a collection of result data from this procedure, however I'm trying to make things as simple as possible and make sure I'm not causing the memory leak myself.
    Below is what makes the SOAP calls (using the widely circulated UTL_SOAP_API) to get our data and then extracts the relevant parts. Each office (call) should return between 200 and 1200 employee records.
    PROCEDURE get_employees (p_office_id IN VARCHAR2)
    l_request utl_soap_api.t_request;
    l_response utl_soap_api.t_response;
    l_data_clob CLOB;
    l_xml_namespace VARCHAR2(100) := 'xmlns="' || G_XMLNS_PREFIX || 'EMP.wsGetEmployees"';
    l_xml_doc xmldom.DOMDocument;
    l_node_list xmldom.DOMNodeList;
    l_node xmldom.DOMNode;
    parser xmlparser.Parser;
    l_emp_id NUMBER;
    l_emp_first_name VARCHAR2(100);
    l_emp_last_name VARCHAR2(100);
    BEGIN
    --Set our authentication information.
    utl_soap_api.set_proxy_authentication(p_username => G_AUTH_USER, p_password => G_AUTH_PASS);
    l_request := utl_soap_api.new_request(p_method => 'wsGetEmployees',
    p_namespace => l_xml_namespace);
    utl_soap_api.add_parameter(p_request => l_request,
    p_name => 'officeId',
    p_type => 'xsd:string',
    p_value => p_office_id);
    l_response := utl_soap_api.invoke(p_request => l_request,
    p_url => G_SOAP_URL,
    p_action => 'wsGetEmployees');
    dbms_lob.createtemporary(l_data_clob, cache=>FALSE);
    l_data_clob := utl_soap_api.get_return_clob_value(p_response => l_response,
    p_name => '*',
    p_namespace => l_xml_namespace);
    l_data_clob := DBMS_XMLGEN.CONVERT(l_data_clob, 1); --Storing in CLOB converted symbols (<">) into escaped values (&lt;, &qt;, &gt;).  We need to CONVERT them back.
    parser := xmlparser.newParser;
    xmlparser.parseClob(parser, l_data_clob);
    dbms_lob.freetemporary(l_data_clob);
    l_xml_doc := xmlparser.getDocument(parser);
    xmlparser.freeparser(parser);
    l_node_list := xslprocessor.selectNodes(xmldom.makeNode(l_xml_doc),'/employees/employee');
    FOR i_emp IN 0 .. (xmldom.getLength(l_node_list) - 1)
    LOOP
    l_node := xmldom.item(l_node_list, i_emp);
    l_emp_id := dbms_xslprocessor.valueOf(l_node, 'EMPLOYEEID');
    l_emp_first_name := dbms_xslprocessor.valueOf(l_node, 'FIRSTNAME');
    l_emp_last_name := dbms_xslprocessor.valueOf(l_node, 'LASTNAME');
    END LOOP;
    xmldom.freeDocument(l_xml_doc);
    END get_employees;
    All of this works just fine for smaller result sets, or fewer iterations (only the first two or three offices). Even up to the point of failure the data is being extracted correctly - it just eventually runs out of memory. Is there any way to free up the xslprocessor? I've even tried issuing DBMS_SESSION.FREE_UNUSED_USER_MEMORY but it makes no difference.

    Replying to both of you -
    Line 206 is the first call to xslprocessor.valueof:
    LINE TEXT
    206 l_emp_id := dbms_xslprocessor.valueOf(l_node, 'EMPLOYEEID');
    This is one function inside of a larger package (the UTL_INTERFACE_PKG). The package is just a grouping of these functions - one for each type of SOAP interface we're using. None of the others exhibited this problem, but then none of them return anywhere near this much data either.
    Here is the contents of V$TEMPORARY_LOBS immediately after the crash:
    SID CACHE_LOBS NOCACHE_LOBS ABSTRACT_LOBS
    132 0 0 0
    148 19 1 0
    SID 132 is a SYS session and SID 148 is mine.
    I've discovered with further testing that if I comment out all of the xslprocessor.valueof calls except for the first one the code will complete successfully. It executes the valueof call 99,463 times. If I then uncomment one of those additional calls, we double the number of executions to a theoretical 198,926 (which is greater than the 161,500 point where it usually crashes) and it runs out of memory again.

  • Bug:4705928 PLSQL: Memory leak using small varrays

    We have Oracle version 10.2.0.1.0
    We have a problem with a procedure.
    In our scenario we make use of VARRAY in the procedure to pass some filter parameters to a select distinct querying a view made on three tables.
    Unfotunately not always execution it is successful.
    Sometimes it returns wrong value (0 for the count parameter), sometimes (rarely) the server stops working.
    We suspect that this is caused by a bug fixed in versione 10.2.0.3.0
    Bug:4705928 PLSQL: Memory leak using small varrays when trimming the whole collection and inserting into it in a loop
    We suspect this becasue we made two procedure the first (spProductCount) uses a function (fnProductFilter) to calculate the values of a varray and passes them into the select,
    while in the second procedure (spProductCount2) parameters are passed directly into the statement without varray
    and there are failures only in the first procedure.
    On the other hand on another server 10.2.0.1.0 we never have this problem.
    The instance manifesting the bug runs under shared mode, while the other is under dedicated mode.
    Turning the first one to dedicated mode makes the bugs disapear.
    Unfortunately this is not a solution.
    In the sample there are the three table with all constraints, the view, tha varray custom type, the function and the two procedures.
    Is there someone that may examine our sample and tell us if the pl/sql code corresponds to the bug desciption.
    We also want to know if it's possibile that the same server running under different mode (SHARED/DEDICATED) doesn't behave the same way.
    The tables:
    --Products
    CREATE TABLE "Products" (
         "Image" BLOB
         , "CatalogId" RAW(16)
         , "ProductId" RAW(16)
         , "MnemonicId" NVARCHAR2(50) DEFAULT ''
         , "ProductParentId" RAW(16)
    ALTER TABLE "Products"
         ADD CONSTRAINT "NN_Products_M04" CHECK ("CatalogId" IS NOT NULL)
    ALTER TABLE "Products"
         ADD CONSTRAINT "NN_Products_M05" CHECK ("ProductId" IS NOT NULL)
    ALTER TABLE "Products"
    ADD CONSTRAINT "PK_Products"
    PRIMARY KEY ("ProductId")
    CREATE INDEX "IX_Products"
    ON "Products" ("CatalogId", "MnemonicId")
    CREATE UNIQUE INDEX "UK_Products"
    ON "Products" (DECODE("MnemonicId", NULL, NULL, RAWTOHEX("CatalogId") || "MnemonicId"))
    --Languages
    CREATE TABLE "Languages" (
         "Description" NVARCHAR2(250)
         , "IsStandard" NUMBER(1)
         , "LanguageId" RAW(16)
         , "MnemonicId" NVARCHAR2(12)
    ALTER TABLE "Languages"
         ADD CONSTRAINT "NN_Languages_M01" CHECK ("LanguageId" IS NOT NULL)
    ALTER TABLE "Languages"
         ADD CONSTRAINT "NN_Languages_M05" CHECK ("MnemonicId" IS NOT NULL)
    ALTER TABLE "Languages"
    ADD CONSTRAINT "PK_Languages"
    PRIMARY KEY ("LanguageId")
    ALTER TABLE "Languages"
    ADD CONSTRAINT "UK_Languages"
    UNIQUE ("MnemonicId")
    --ProductDesc
    CREATE TABLE "ProductDesc" (
         "Comment" NCLOB
         , "PlainComment" NCLOB
         , "Description" NVARCHAR2(250)
         , "DescriptionText" NCLOB
         , "PlainDescriptionText" NCLOB
         , "LanguageId" NVARCHAR2(12)
         , "ProductId" RAW(16)
    ALTER TABLE "ProductDesc"
         ADD CONSTRAINT "NN_ProductDescM01" CHECK ("LanguageId" IS NOT NULL)
    ALTER TABLE "ProductDesc"
         ADD CONSTRAINT "NN_ProductDescM02" CHECK ("ProductId" IS NOT NULL)
    ALTER TABLE "ProductDesc"
    ADD CONSTRAINT "PK_ProductDesc"
    PRIMARY KEY ("ProductId", "LanguageId")
    ALTER TABLE "ProductDesc"
    ADD CONSTRAINT "FK_ProductDesc1"
    FOREIGN KEY("ProductId") REFERENCES "Products" ("ProductId")
    ALTER TABLE "ProductDesc"
    ADD CONSTRAINT "FK_ProductDesc2"
    FOREIGN KEY("LanguageId") REFERENCES "Languages" ("MnemonicId")
    /The view:
    --ProductView
    CREATE OR REPLACE VIEW "vwProducts"
    AS
         SELECT
               "Products"."CatalogId"
              , "ProductDesc"."Comment"
              , "ProductDesc"."PlainComment"
              , "ProductDesc"."Description"
              , "ProductDesc"."DescriptionText"
              , "ProductDesc"."PlainDescriptionText"
              , "Products"."Image"
              , "Languages"."MnemonicId" "LanguageId"
              , "Products"."MnemonicId"
              , "Products"."ProductId"
              , "Products"."ProductParentId"
              , TRIM(NVL("ProductDesc"."Description" || ' ', '') || NVL("ParentDescriptions"."Description", '')) "FullDescription"
         FROM "Products"
         CROSS JOIN "Languages"
         LEFT OUTER JOIN "ProductDesc"
         ON "Products"."ProductId" = "ProductDesc"."ProductId"
         AND "ProductDesc"."LanguageId" = "Languages"."MnemonicId"
         LEFT OUTER JOIN "ProductDesc" "ParentDescriptions"
         ON "Products"."ProductParentId" = "ParentDescriptions"."ProductId"
         AND ("ParentDescriptions"."LanguageId" = "Languages"."MnemonicId")
    /The varray:
    --CustomType VARRAY
    CREATE OR REPLACE TYPE Varray_Params IS VARRAY(100) OF NVARCHAR2(1000);
    /The function:
    --FilterFunction
    CREATE OR REPLACE FUNCTION "fnProductFilter" (
         parCatalogId "Products"."CatalogId"%TYPE,
         parLanguageId                    NVARCHAR2 := N'it-IT',
         parFilterValues                    OUT Varray_Params
    RETURN INTEGER
    AS
         varSqlCondition                    VARCHAR2(32000);
         varSqlConditionValues          NVARCHAR2(32000);
         varSql                              NVARCHAR2(32000);
         varDbmsCursor                    INTEGER;
         varDbmsResult                    INTEGER;
         varSeparator                    VARCHAR2(2);
         varFilterValue                    NVARCHAR2(1000);
         varCount                         INTEGER;
    BEGIN
         varSqlCondition := '(T_Product."CatalogId" = HEXTORAW(:parentId)) AND (T_Product."LanguageId" = :languageId )';
         varSqlConditionValues := CHR(39) || TO_CHAR(parCatalogId) || CHR(39) || N', ' || CHR(39 USING NCHAR_CS) || parLanguageId || CHR(39 USING NCHAR_CS);
         parFilterValues := Varray_Params();
         varSql := N'SELECT FilterValues.column_value FilterValue FROM TABLE(Varray_Params(' || varSqlConditionValues || N')) FilterValues';
         BEGIN
              varDbmsCursor := dbms_sql.open_cursor;
              dbms_sql.parse(varDbmsCursor, varSql, dbms_sql.native);
              dbms_sql.define_column(varDbmsCursor, 1, varFilterValue, 1000);
              varDbmsResult := dbms_sql.execute(varDbmsCursor);
              varCount := 0;
              LOOP
                   IF (dbms_sql.fetch_rows(varDbmsCursor) > 0) THEN
                        varCount := varCount + 1;
                        dbms_sql.column_value(varDbmsCursor, 1, varFilterValue);
                        parFilterValues.extend(1);
                        parFilterValues(varCount) := varFilterValue;
                   ELSE
                        -- No more rows to copy
                        EXIT;
                   END IF;
              END LOOP;
              dbms_sql.close_cursor(varDbmsCursor);
         EXCEPTION WHEN OTHERS THEN
              dbms_sql.close_cursor(varDbmsCursor);
              RETURN 0;
         END;
         FOR i in parFilterValues.first .. parFilterValues.last LOOP
              varSeparator := ', ';
         END LOOP;
         RETURN 1;
    END;
    /The procedures:
    --Procedure presenting anomaly\bug
    CREATE OR REPLACE PROCEDURE "spProductCount" (
         parCatalogId "Products"."CatalogId"%TYPE,
         parLanguageId NVARCHAR2 := N'it-IT',
         parRecords OUT NUMBER
    AS
         varFilterValues Varray_Params;
         varResult INTEGER;
         varSqlTotal VARCHAR2(32000);
    BEGIN
         parRecords := 0;
         varResult := "fnProductFilter"(parCatalogId, parLanguageId, varFilterValues);
         varSqlTotal := 'BEGIN
         SELECT count(DISTINCT T_Product."ProductId") INTO :parCount FROM "vwProducts" T_Product
              WHERE ((T_Product."CatalogId" = HEXTORAW(:parentId)) AND (T_Product."LanguageId" = :languageId ));
    END;';
         EXECUTE IMMEDIATE varSqlTotal USING OUT parRecords, varFilterValues(1), varFilterValues(2);
    END;
    --Procedure NOT presenting anomaly\bug
    CREATE OR REPLACE PROCEDURE "spProductCount2" (
         parCatalogId "Products"."CatalogId"%TYPE,
         parLanguageId NVARCHAR2 := N'it-IT',
         parRecords OUT NUMBER
    AS
         varFilterValues Varray_Params;
         varResult INTEGER;
         varSqlTotal VARCHAR2(32000);
    BEGIN
         parRecords := 0;
         varSqlTotal := 'BEGIN
         SELECT count(DISTINCT T_Product."ProductId") INTO :parCount FROM "vwProducts" T_Product
              WHERE ((T_Product."CatalogId" = HEXTORAW(:parentId)) AND (T_Product."LanguageId" = :languageId ));
    END;';
         EXECUTE IMMEDIATE varSqlTotal USING OUT parRecords, parCatalogId, parLanguageId;
    END;Edited by: 835125 on 2011-2-9 1:31

    835125 wrote:
    Using VARRAY was the only way I found to transform comma seprated text values (e.g. "'abc', 'def', '123'") in a collection of strings.A varray is just a functionally crippled version of a nested table collection type, with a defined limit you probably don't need. (Why 100 specifically?) Instead of
    CREATE OR REPLACE TYPE varray_params AS VARRAY(100) OF NVARCHAR2(1000);try
    CREATE OR REPLACE TYPE array_params AS TABLE OF NVARCHAR2(1000);I don't know whether that will solve the problem but at least it'll be a slightly more useful type.
    What makes you think it's a memory leak specifically? Do you observe session PGA memory use going up more than it should?
    btw good luck with all those quoted column names. I wouldn't like to have to work with those, although they do make the forum more colourful.
    Edited by: William Robertson on Feb 11, 2011 7:54 AM

  • Do I need to worry about these event handlers in a grid from a memory leak perspective?

    I'm pretty new to Flex and coudn't figure out how to add event handlers to inline item renderer components from the containing file script so I attached the listnerers simply as part of the components themselves (eg <mx:Checkbox ... chnage="outerDocument.doSomething(event)"../>):
    <mx:DataGrid id="targetsGrid" width="100%" height="100%" doubleClickEnabled="true" styleName="itemCell"
          headerStyleName="headerRow" dataProvider="{targets}"
          rowHeight="19" fontSize="11" paddingBottom="0" paddingTop="1">
         <mx:columns>
         <mx:DataGridColumn width="78" dataField="@isSelected" headerText="">
         <mx:itemRenderer>
              <mx:Component>
                   <mx:HBox width="100%" height="100%" horizontalAlign="center">
                        <mx:CheckBox id="targetCheckBox" selected="{data.@isSelected == 'true'}"
                             change="outerDocument.checkChangeHandler(event);"/>
                        <mx:Image horizontalAlign="center" toolTip="Delete" source="@Embed('/assets/icons/delete.png')" useHandCursor="true" buttonMode="true"
                             click="outerDocument.deleteHandler(event);"/>
                        <mx:Image id="editButton" horizontalAlign="center" toolTip="Edit" source="@Embed('/assets/icons/edit-icon.png')" useHandCursor="true" buttonMode="true"
                             click="outerDocument.editHandler(event);"/>
                   </mx:HBox>
              </mx:Component>
         </mx:itemRenderer>
         </mx:DataGridColumn>
              <mx:DataGridColumn id="Name" dataField="@collectionDesc" headerText="Name" itemRenderer="com.foobar.integrated.media.ui.component.CellStyleForTargetName"/>
              <mx:DataGridColumn id="Created" width="140" dataField="@createDateTime" headerText="Created"  labelFunction="UiHelper.gridDateFormat" />
         </mx:columns>
    </mx:DataGrid>
    This grid is part of a view that will get destroyed and recreated potentially many times during a user's session within the application (there's a large dynamic nature to the app and views are created at run-time.) By destroyed I mean that the view that holds the above datagrid will no longer be referenced under certain circumstances and an entire new view object is created (meaning the old datagrid is no longer refernced and a new one is created.)
    I heard you should clean up event handlers when they are no longer used, and I know at what point the view is destroyed, but I don't know how to clean up the event handlers added to the item renderer components? Is it something that the Flex garbage collector will handle efficiently?
    Also, on a somewhat related note, how could I push the item renderer to an external component since in my event handlers for the item renderer buttons I need a reference to the datagrid.selectedIndex which, as an external item renderer I wouldn't have access to this containing grid?

    No. You don't need explicit cleanup in this case: if your outerDocument is going away, you have nothing to worry about. The event handler leak can happen in sort of the reverse situation: suppose you have a long-lived MyView that contains a custom DataGrid like the one below. Now suppose that MyView frequently destroys and re-creates the grid. And suppose that on its creationComplete event, the grid registers a listener for outerDocument's (MyView's) enterFrame Event. Unless you explicitly remove this listener, MyView will still have a reference to it even after the grid that registered the listener is destroyed (and garbage collected).
    This is a pretty contrived example, but it sort of illustrates the potential for leaks: a certain component is elligible for garbage collection, but some longer-lived component holds a reference to it (or part of it, such as a listener function). If the longer-lived component is elligible for GC as well, you don't really need to worry about proper cleanup. That's what you're paying the GC processor cycles for.

  • JBoss EAP 6 On JRockit - Memory Leak

    hello team.
    I have memory leak problem on jboss and jrockit.
    My Environment :
    1. OS :          
    CentOS release 6.4 (Final)
    2. JRockit :     
    java version "1.6.0_45"
         Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
         Oracle JRockit(R) (build R28.2.7-7-155314-1.6.0_45-20130329-0641-linux-x86_64, compiled mode)
    3. Application Server:
    JBoss EAP 6.2.0.GA
    4. Application
    Large EJB Application (100 and more EJB Beans (Stateless, Stateful,  MDB, Timers and so on)
    Everything works fine on older application server versions (4.3 , 4.2)
    But now I have Problem
    Of course I know that problem is new version - and i have discussion on JBoss forums.
    but guys I have question about jrockit with you:
    What is the option "Other" in memory ??
    [jboss@jboss-new bin]$ jrcmd 17114  print_memusage
    17114:
    Total mapped                       8457864KB           (reserved=2983100KB)
    -              Java heap              3145728KB           (reserved=0KB)
    -              GC tables            105232KB         
    -          Thread stacks       46412KB           (#threads=138)
    -          Compiled code       1048576KB           (used=12257KB)
    -               Internal                   1480KB         
    -                     OS       170324KB         
    -                  Other       3639056KB         
    -            Classblocks         10496KB           (malloced=9631KB #28393)
    -        Java class data       289536KB           (malloced=192391KB #133697 in 28393 classes)
    - Native memory tracking     1024KB           (malloced=294KB #10)
    [jboss@jboss-new bin]$
    This size increases every time - and took entire amount of RAM.
    Thank in Advance.
    Regards,
    Paata Lominadze

    Not sure what the 'other' is, but it is probably best shown by using an example. By using displayMap we can display a memory map of various JVM subsystems and libraries that are loaded, including third-party libraries.
    ./jrcmd 4523 print_memusage displayMap
    Total mapped                  3984796KB           (reserved=2978740KB)
    -              Java heap       524288KB           (reserved=0KB)
    -              GC tables        17548KB         
    -          Thread stacks        20276KB           (#threads=39)
    -          Compiled code      1048576KB           (used=14224KB)
    -               Internal         1672KB         
    -                     OS       146924KB         
    -                  Other      2092648KB         
    -            Classblocks         7424KB           (malloced=7381KB #20064)
    -        Java class data       124416KB           (malloced=124411KB #91048 in 20064 classes)
    - Native memory tracking         1024KB           (malloced=118KB #10)
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
        OS                          *java    r x 0x0000000000400000.(     76KB)
        OS                          *java    rw  0x0000000000612000.(      4KB)
        OS                        *[heap]    rw  0x00000000007c1000.(    132KB)
       INT                           Poll    r   0x000000007fffe000 (      4KB)
       INT                         Membar    rw  0x000000007ffff000.(      4KB)
       MSP              Classblocks (1/2)    rw  0x00000000df8c0000 (   6912KB)
       MSP              Classblocks (2/2)    rw  0x00000000dff80000 (    512KB)
      HEAP                      Java heap    rw  0x00000000e0000000.( 524288KB)
        OS                    *ld-2.12.so    r x 0x0000003664400000.(    128KB)
        OS                    *ld-2.12.so    r   0x000000366461f000 (      4KB)
        OS                    *ld-2.12.so    rw  0x0000003664620000 (      4KB)
        OS                   **ld-2.12.so    rw  0x0000003664621000.(      4KB)
       OS           *gconv-modules.cache    r   0x00007f8f2e4a0000 (     28KB)
    THREAD                     Stack 4630    rwx 0x00007f8f2e4a7000 (      8KB)
    THREAD                     Stack 4630        0x00007f8f2e4a9000 (     12KB)
    THREAD                     Stack 4630    rwx 0x00007f8f2e4ac000 (    244KB)
       MSP         Java class data (5/37)    rw  0x00007f8f2e4e9000 (  14336KB)
       MSP         Java class data (9/37)    rw  0x00007f8f2fa40000 (   5888KB)
                                             rw  0x00007f8f30000000 (    188KB)
                                                 0x00007f8f3002f000 (  65348KB)
                                             rw  0x00007f8f34000000 (    132KB)
                                                 0x00007f8f34021000 (  65404KB)
                                             rw  0x00007f8f38000000 (    412KB)
                                                 0x00007f8f38067000.(  65124KB)
       MSP        Java class data (10/37)    rw  0x00007f8f3c034000 (  34048KB)
                                             rw  0x00007f8f3e174000 (   8200KB)
       MSP        Java class data (11/37)    rw  0x00007f8f3e976000 (    256KB)
        OS                     *libhpi.so    rw  0x00007f8fb37fc000 (      8KB)
        OS                    **libhpi.so    rw  0x00007f8fb37fe000 (      4KB)
      CODE                  Compiled code    rwx 0x00007f8fb37ff000 (     64KB)
      CODE                  Compiled code    rwx 0x00007f8fb380f000 (    128KB)
      CODE                  Compiled code    rwx 0x00007f8fb382f000 (     64KB)
      MSP        Java class data (37/37)    rw  0x00007f8ff83a1000 (    512KB)
        GC Modified Union Set (committed)    rw  0x00007f8ff8421000 (    132KB)
        GC                     Card table    rw  0x00007f8ff8442000 (   1024KB)
        GC        Object bits (committed)    rw  0x00007f8ff8542000 (   8196KB)
    Here
    - thread is thread related (such as thread stacks)
    - int, internal use (such as pointer pages)
    - heap, chunk used by JRockit for the Java heap
    - os, mapped directly from the operating system, such as third party DLLs or shared objects
    - msp, memory space. a memory space is a native heap with a specific purpose, for example native memory allocation inside the JVM
    - gc, garbage collection related, for example live bits
    - code, compiled code
    The 'other' memory space looks to me (from the blank entries in the above print-out) like they are a memory pages to are still not used. When the JVM starts it mappes an amount of memory. To my knowledge JRockit uses mmap (mmap(2) - Linux manual page), which creates a new mapping in the virtual address space. JRockit reserves an amount of memory (Java Heap (heap where your object instances go) + its own runtime (all the others)).
    To see where the growth is in the various memory spaces, you can use 'print_memusage baseline', after which you can execute print_memusage again, for example,
    ./jrcmd 4523 print_memusage scale=M
    4523:
    Total mapped                     3896MB      +4MB (reserved=2905MB -3MB)
    -              Java heap          512MB           (reserved=0MB)
    -              GC tables           17MB         
    -          Thread stacks           19MB           (#threads=39)
    -          Compiled code         1024MB           (used=14MB +1MB)
    -               Internal            1MB         
    -                     OS          143MB         
    -                  Other         2043MB         
    -            Classblocks            7MB           (malloced=7MB #20596 +532)
    -        Java class data          126MB      +4MB (malloced=125MB +4MB #93640 +2592 in 20596 classes)
    - Native memory tracking            1MB           (malloced=0MB #20 +10)
    Note the additional column that prints out the difference in memory usage in relation to the baseline. You can also monitor native allocations by using trace_alloc_sites, memory allocations can then be displayed with different levels of detail using the level argument.
    ./jrcmd 4523 print_memusage trace_alloc_sites=true
    4523:
    Total mapped                  3989660KB   +4864KB (reserved=2974732KB -4008KB)
    -              Java heap       524288KB           (reserved=0KB)
    -              GC tables        17548KB         
    -          Thread stacks        20276KB           (#threads=39)
    -          Compiled code      1048576KB           (used=15265KB +1040KB)
    -               Internal         1672KB         
    -                     OS       146924KB         
    -                  Other      2092648KB         
    -            Classblocks         7680KB    +256KB (malloced=7669KB +287KB #20596 +532)
    -        Java class data       129024KB   +4608KB (malloced=128967KB +4555KB #93640 +2592 in 20596 classes)
    - Native memory tracking         1024KB           (malloced=236KB +118KB #20 +10)
    ./jrcmd 4523 print_memusage level=3
    4523:
    Total mapped                  3989660KB   +4864KB (reserved=2974732KB -4008KB)
    -              Java heap       524288KB           (reserved=0KB)
    -              GC tables        17548KB         
    -          Thread stacks        20276KB           (#threads=39)
    -          Compiled code      1048576KB           (used=15265KB +1040KB)
    -               Internal         1672KB         
    -                     OS       146924KB         
    -                  Other      2092648KB         
    -            Classblocks         7680KB    +256KB (malloced=2KB -7379KB #4 -20060) Not fully traced
    -        Java class data       129024KB   +4608KB (malloced=26KB -124385KB #16 -91032 in 20596 classes) Not fully traced.
    - Native memory tracking         1024KB           (malloced=118KB #10) Not fully traced.
         gather_memorymap_database                     memtrace.c: 206         91KB     +91KB (#1 +1)
               gather_memory_usage                  osal_mspace.c:5142          7KB      +7KB (#4 +4)
      msGatherMSpacesUsageDatabase                  osal_mspace.c:6128          2KB      +2KB (#1 +1)
      msGatherMSpacesUsageDatabase                  osal_mspace.c:6134         16KB     +16KB (#1 +1)
    Note this is more on the JVM level, in your case in might be beneficial to investigate what is happening on the java heap. By using print_object_summary you can get insight how memory on the heap is used on a per-class basis. To get to the bottom of where the memory leak is you can use the memory-leak-detector (an example of its use can be found here Middleware Snippets: Fast, Faster, JRockit). You can also obtain a heapdump that can be analyzed by using for example MAT (see for an example here Middleware Snippets: Visualizing Class Loading). To obtain a heapdump you can run the command, for example,
    [weblogic@machine1 bin]$ ./jrcmd 4523 runsystemgc full=true fullcompact=true
    4523:
    [weblogic@machine1 bin]$ ./jrcmd 4523 hprofdump filename=/home/weblogic/dump.hprof
    4523:
    Wrote dump to /home/weblogic/dump.hprof
    Note that this first issues a full GC by using the runsystemgc command.

Maybe you are looking for