Memory management problem

hi everyone.
I m trying to use OpenCV in After Effects. The problem is that OpenCV has its own management of memory.
The AE memory management is kind of bound to the lock/unlock system for multi thread processing and is kind of difficult to use from openCV...
So, as long as you dont use multi processing, I thought that using openCV would not be a problem.
But I was wrong. I got a random error:
After Effects error: Effects modules should only dispose worlds they have allocated.
My effect is allocating a lot of opencv layers, and one temporary AE layer. When I dispose the AE temporary layer, I have some errors when the rendering get slow and the user tries to interrupt it. the  "After Effects error: Effects modules should only dispose worlds they have allocated."
When looking at the layer before disposing it, It s totally corrupted with random values for all the field, but data field is not NULL.
I did not get any error during the memory allocation of the layer though. Still it gets corrupted at some point.
I m wondering if it is openCV memory and AE memory that get into conflict or if it s my way of checking if layer has not been correctly allocated that is wrong.
I dont understand also why it would conflict, since system will allocate the memory on demand, and there is no reason the system would give conflicting memory regions....
I solved my problem by stopping using the AE temporary layer.
If anyone experienced and solved this kind of problem, please, let me know.
Regards

hey marc,
I think you are overcomplicating things a little,
1) add a local variable of type PF_LayerDef (or allocate on heap); no
need to initialise anything
2) WorldSuite1()->new_world()
3) use the layer. use PF_GET_PIXEL_DATA8() to get pixels
4) WorldSuite1()->dispose_world() (optionally free a heap variable)
Am 28.07.2011 05:06, schrieb salvati marc:
I m back to this problem...
As always, Shachar, it seems you are right. I deactivated OpenCV code, and... still crashing.
I investigate the problem more in depth and found my mistakes...
What I was doing was:
1) allocating my tmp layer
2) copying source to tmp
3) processing with opencv
4) copying back to output
5) cleaning tmp layer
I did few mistakes:
1) I was checking tmpLayer->data == NULL to see if the tmp layer was right or not (in step 5). BUT, I copyed my source to tmp (step 2) even if it was not correctly allocated... I guess that s why when I check NULL before dispose it was not consistent
2) I did not always set the  tmpLayer->data to NULL before allocation! default value is not NULL. So my check after allocation was not consistent in some case
So multiple reason of not getting a NULL data although the data where not allocated...
Like you said,  ill supervised creating/disposing of worlds...
Anyways, I realized in my algorithm that i did not nid the tmp layer, and I could just use the output layer for that purpose... But i m sure i ll get this problem again in the near future, so I had to investigate that.
Thanks again for your precious help.
Regards.
>

Similar Messages

  • OSX inactive memory management problems

    On my 2010 Macbook Air 11" running OSX 10.8 Mountain Lion, I have run into some major issues with memory management. This problem persists across both my Mac machines and multiple generations of OSX. I have a 2007 2.2 Ghz Core 2 Duo Macbook Pro Running Lion (upgraded from Tiger) with 3 gb 667Mhz DDR2 RAM and my 2010 Air 1.4Ghz Core 2 Duo (Upgraded from Snow Leopard to Mountain Lion) with 2gb 1067mhz DDR3 RAM. On both machines, for some time now, during normal usage; especially web browsing using Chrome and Safari (respectively); the inactive RAM on both machines will grow to consume around 30% of all RAM and force time consuming page outs to the mass storage drives on both machines. The Pro has a slower hard drive and the problem is the worst here, the air has a much faster SSD. I have found myself constantly having a window of Activity Monitor up on at least one of my desktops watching my RAM usage, using terminal to purge ram upwards of 10 times an hour to prevent costly page outs, especially on the Pro. I know Apple claims that inactive RAM is essentially free RAM that is temporarily storing recently used information for ease of access later and that it's supposed to be released as free memory when needed, but this obviously is not happening. Right now on my air my swap file is over 650Mb and I've seen it top 2Gb before. The air is exponentially better than the Pro due to the faster SSD, but I do notice substantial UI lag and a massive drop in fluidity as soon as my meager 2Gb is full and I start paging. The Pro is another story entirely, the entire system will essentially become unusable, having to wait several seconds for mouse clicks to even register. That's why I upgraded the stock 2Gb of RAM it comes with to 3Gb hoping that a 150% increase in RAM would help, but it just prolonged the inevitable. I still end up paging out just as bad across both systems if un checked. Even when I keep a close eye on memory usage and purge often, I still end up paging out because I'm not vigilant enough.
    I have to limit my browsing to less than 5 tabs and keep my number of open programs less than 2 on both machines. My active and wired memory rarely seem to top 70%, meaning the rest gets taken by inactive, which isn't functioning as Apple claims. Even if my conclusions aobut what is happening under the hood are incorrect, something is going terribly wrong. I can't upgrade the RAM on my Air at all, and the RAM on my Pro is capped at 4Gb. I'm holding on upgrading because I don't think the excess hardware will solve this software memory problem. Whatever is happening is causing a serious drop in performance for me (yes I do know I have underpowered machines), but there has to be something I can do to speed performance. I've read about disabling the dynamic page file entirely, which just seems to crash the system when free memory is gone, and I've read about programs that claim to free memory. Those programs seem to work by taking a high priority in the process heigharchy of the OS and then proceeding to eat up large portions of RAM and releasing them as needed in an attempt to replicate the true intentions of inactive RAM, but I've heard of problems with this method as well. Does anyone have a viable solution? Monitoring my RAM usage myself and ensuring I don't end up paging out is costly, time consuming, annoying, and inefficient since I fail to catch the problem before I page if I get particularly busy. There is no other OS I've ever been acquainted with that has this problem, not any flavor of Linux, not even the dreaded windows. I seriously hope Apple can do something to manage this runaway memory problem. I'd like to be able to open more than 3 windows in Safari. I've had to purge 3 seperate times while writing this on my Air, and I now have 678 inactive memory, 741 inactive, 582 wired, and less than 14Mb free out of 2Gb with a growing swap at 680Mb. Each purge becomes less and less effective and the last one I did freed up only about 100Mb and it got eaten up again by inactive in less than 10 seconds. On my Air, the memory hog is Safari right now at 700Mb between the web content and flash player with only Facebook, youtube, and this Apple Supprt tab open. I have NO other applications running in the fore or background other than Activity Monitor and Terminal. On my Pro the memory hog is always kernel task, I use Chrome and Safari both. While the memory used by the browser does not usually take up the most substantial portion of the total used RAM out of any process, the more tabs I open, the more RAM I use. The browser is usually the second heaviest RAM hog to Kernel Task. So it seems that across the two machines there are two lsightly different manifestations of the same problem with the same results: massive performance drops and extremely annoying and costly page outs no matter the reason. I just want this problem to go away. I've used underpowered windows laptops that can open a dozen tabs in a heavier browser like IE or Firefox while using other programs like Word or Excel and more with no memory lag issues. There's no way in **** I could manage to open that many pages in a browser while using Pages and/or Numbers on either of my machines and expect reliable (swap free performance). This is just kind of sad in my opinion. Does anyone have a way to get my OSX machine running smooth so that I can remove the one thing that windows and Linux fan boys get the right to laugh at my Macs for?

    Hi Zephryl,
    I was actually able to get an initial response from Sun on this a few months ago. However, the Sun Swing team has not followed up on a resolution for this pervasive problem, even though they noticed the same problem when running a test applet I had created for them. Apparently, I.E. is not releasing memory from the heap.
    Below is a quote from a Sun rep. on this in an e-mail sent to me on Dec 4, 2002:
    "I suspected the leak is in the native code because the # of handles and GDI objects keep increasing but no obvious Java objects are left behind in the Java heap during page switch."
    So, until Sun and/or Microsoft work out a solution to this, anyone who uses I.E. 6 and applets for their UI seems to be in a lot of trouble.
    As a note, trying to invoke the Garbage Collector does not do anything, but generally a very small amount of memory will be released (like maybe 5-10% of the memory allocated for the applet).
    Cheers!
    Avi Gray
    Global Computer Enterprises

  • Large SGA On Linux and Automatic Shared Memory Management problem

    Hello
    I use Oracle10gR2 in linux 32bit and I use http://www.oracle-base.com/articles/linux/LargeSGAOnLinux.php manual
    for larger SGA it works fine but when I set sga_target parameter for using Automatic Shared Memory Management
    I recieve this error
    ERROR at line 1:
    ORA-02097: parameter cannot be modified because specified value is invalid
    ORA-00824: cannot set sga_target due to existing internal settings, see alert
    log for more information
    and in alert log it has been wrote
    Cannot set sga_target with db_block_buffers set
    my question is when using db_block_buffers can't use Automatic Shared Memory Management ?
    Is any solution for using both Large SGA and Automatic Shared Memory Management ?
    thanks
    Edited by: TakhteJamshid on Feb 14, 2009 3:39 AM

    TakhteJamshid wrote:
    Do it means that when we use large SGA using Automatic Shared Memory Management is impossible ?Yes its true. An attempt to do so will result inthis,
    >
    ORA-00825: cannot set DB_BLOCK_BUFFERS if SGA_TARGET or MEMORY_TARGET is set
    Cause: SGA_TARGET or MEMORY_TARGET set with DB_BLOCK_BUFFERS set.
    Action: Do not set SGA_TARGET, MEMORY_TARGET or use new cache parameters, and do not use DB_BLOCK_BUFFERS which is an old cache parameter.>
    HTH
    Aman....

  • MAC OS X Lion performance problem - broken memory management

    Starting with OS X 10.5 there are evident memory management problems in MAC OS X. The web was already then cluttered with complaints about system slowing down dramatically after some time. Back then i had slower machine, Mac Mini with 1GB RAM, so i (wrongly) concluded that it was due to inferior hardware.
    Now i have 2010 MBP, core i7, 8 GB RAM, dual GPU.
    Mac os X Snow Leopard was pain, but after migrating to OS X Lion, working some serious stuff on MAC started to be a nightmare.
    I finally managed to reproduce the problematic scenario, so i run the test and recorded the screen, into video.
    http://www.youtube.com/watch?v=u5wZwZh61_4
    I run the tar+bzip command, which is basic unix stuff, on the large amount of picture files, in my Pictures/ folder. Just before start, i run the "purge" command, to delete inactive/cached program data.
    You can see on the video that free memory starts to drop very fast, and inactive is constantly rising. If you take a look at "bsdtar" command, it takes only a fragment of RAM, so the problem is not in this process. You cannot say that it is a program memory leak, because then the problem would not be in inactive ram, rather in active/wired.
    When the free memory dropped below 100mb, i started some apps, like Safari, iPhoto and MS Word, and you can see in the video, that it takes even minutes to start an app, when normally (when there is free RAM), it would take some 3-5 secs to load.
    I run the same scenario and the same commands on my Linux Centos 6 box, no problem there ! Memory usage is some 10-20mb, no problems with cache/buffer.
    The memory management must be very broken in Mac OS X !

    Broken?  That's a bit harsh.
    Immature?  That's perhaps a better explanation.
    This paper describes Priority Paging as implemented in Solaris 2.7 back in 1998, and that's essentially what Mac OS X is in need of today:
    The problem is that when pages are needed, no differentiation is made between system file cache pages and application pages, and worse, the file cache can actually steal pages needed by applications.
    Finally when Dynamic Pager starts up and needs to start swapping things out, it's fairly heavy weight in operation, and causes the UI not responding cursor (aka the spinning beach ball) to appear.

  • Problems with memory management

    Since my adoption of 10.7, I have noticed a problem that is really reminiscent of 10.2 and 10.3 of poor memory management. This is quite distressing as it has taken away from the performance of the operating system and has created many pages of VM files that are just below the engineering standards of Apple. Any suggestions along this line to clear this up would be greatly helpful. I have 3 GB of memory that is over utilized and over taxed.

    I have read a bit about the "better" memory management, but that is all in theory. In the real world, Lion eats RAM and i upgraded from 4 to 8 Gb last week, that makes all the difference. If i close all apps now, 5.5 Gb RAM is still used, and i know that has something to do with Lions special workmemory management that is supposed to work to our favour, but it doesnt! Now after upgrading, fairly cheap but nothing for mainstream people, things work the way i suppose they are meant to work, but when Windows 7 and soon 8 are working towards less RAM needed, Apple seems to say one thing and do another. That is, they claim to have a improved (superior, fantastic?) system for RAM, but in reality it eats RAM for breakfast. Now i dont haveto close one app before opening another just to avoid the little spinning ball of colours.
    Also Safari can use gigabytes of RAM on its own....not good.

  • Bios update problem (memory manager)

    I'm trying to install arch on a sony vaio pcv-e203 desktop pc. When ever I enable legacy usb support linux becomes very stubborn and gives a bunch of problems. current version of the bios is 6.0.B, I'm trying to update to 6.0.K to try and fix these problems. I'm getting an error that googling can't seem to fix. It launches the bios flash utility and rom file fine, but then gives an error that it can't flash due to a memory manager being in use.
    First I tryed using a windows 98 boot disc instead, which failed with the same error. I read somewhere you can disable himem in config.sys file but the file is blank and i'm not sure what to add. This could be a kernel command to go around this too.
    Symptoms with usb legacy support enabled:
    vga=773 results in black screen and locks keyboard
    locks up at checking if initrd..... (memory failing me, there was more to that line)
    disable it seems to work fine, no usb at post or grub until linux boots. within xorg the mouse lags very bad (PS/2 and USB). everything else works and seems upto speed.
    thanks in advance if anybody can help.

    ok nevermind the above post, I found a utility to make a bootdisk that works from bootdisk.com all my problems went away and am typing this from enlightenment as we speak.

  • Memory Allocation Problems

    My application seems to not free resources the way I would like it to. The main interface consumes somewhere around 40MB. The application has an option to export data to a few PDFs (via itext and JFreeChart). This is handled through a popup JFrame where the user can select options for export. During the export, memory usage spikes to near 105MB, which though concerning, isn't the main problem. Once the export JFrame has been disposed and control is returned the main window, memory usage stays at ~ 105MB and if you export again, the memory usage doesn't budge, leading me to believe that the Objects used during the export aren't being released. I know that memory management is temperamental in Java, but I can't figure out what's going on here.
    Here is an overview of what's happening:
    MainViewer -> SaveView -> ExportFileController:
    I am currently exporting two PDFs: One containing graphs created by JFreeChart and another containing a table created by itext. I've tested them independently and both seem to stay in memory even after I've called document.close() and SaveView.dispose().
    Here is how I'm writing my charts:
    public void writeCharts()
              Iterator chartIter = allCharts.iterator();
              try
                   System.out.println("Writing Charts: Total Number: " + allCharts.size());
                   String outputFile = outputDir.getPath()+"/curvefits.pdf";               
                   writer = PdfWriter.getInstance(document, new FileOutputStream(outputFile));
                   document.open();
                   while(chartIter.hasNext())               
                        numpages++;
                        JFreeChart currentChart = (JFreeChart)chartIter.next();
                        PdfContentByte cb = writer.getDirectContent();
                        PdfTemplate tp = cb.createTemplate(width, height);
                        Graphics2D g2d = tp.createGraphics(width, height, new DefaultFontMapper());
                        Rectangle2D r2d = new Rectangle2D.Double(0, 0, width, height);
                        System.out.println("Writting Chart: " + currentChart.getTitle().getText());          
                        currentChart.draw(g2d, r2d);
                        g2d.dispose();
                        cb.addTemplate(tp, 0, 0);
                        document.newPage();
                        writer.releaseTemplate(tp);  //I had heap errors before I added this
              catch(Exception e)
                   e.printStackTrace();
              document.close();
              writer.flush();
              writer.close();
              allCharts.clear();
              allCharts.trimToSize();          
              System.gc();    //I'm explicitly trying to free up the resources here
              System.runFinalization();
    }

    warnerja wrote:
    Hard to say.
    Once it loads classes, it won't give that memory back, but any memory used on the heap which is no longer needed may be reclaimed.
    Does it keep climbing on repeated exports, or does it basically peak on one export and remain at that usage level upon repeated exports?It peaks on one export and then remains the same on repeated exports (roughly ~105MB). What scares me is the my test set is relatively small (perhaps as small as 1%) of what this application could be used for. I can do some things to minimize memory usage (like writing one page at a time and then appending so I don't have to keep the whole output stream open) at the expense of speed, but some where there has to be a data structure containing all of the items to be written. If the JVM NEVER gives the memory back then this will pretty much cripple the user's system.

  • Error code kernel data inpage , memory management , 0xc000021a , 0xc00000e9 on windows 8

    Hi everyone I am sahasvat.I am using Acer aspire 5755. It's specification are Intel i3 3rd gen processor, 2Gb DDR 3 ram and 500 GB hdd.I am running on windows 8 OS. I opened about 4 tabs on google chrome and suddenly a blue screen with sad face displayed
    an error kernel data inpage and it got restarted and after 5 mins I opened google chrome and again blue screen came and displayed an another error memory management and while restarting on bios I pressed f8 and booted to safe mode as normal
    mode didn't open.soon after 20 mins I restarted my lap and I received an error 0xc000021a bios and windows booted.i then pressed power button for a min and switched on my pc but it showed a different error 0xc00000e9. I restarted many times
    either 0xc000021a or 0xc00000e9 used to come not an fixed error. I don't have my cd as it got scratches on CD.  Plzz help me to get out of this problem.
    I can't even access my laptop and I am using my windows phone to post this.

    Hi everyone I am sahasvat.I am using Acer aspire 5755. It's specification are Intel i3 3rd gen processor, 2Gb DDR 3 ram and 500 GB hdd.I am running on windows 8 OS. I opened about 4 tabs on google chrome and suddenly a blue screen with sad face displayed
    an error kernel data inpage and it got restarted and after 5 mins I opened google chrome and again blue screen came and displayed an another error memory management and while restarting on bios I pressed f8 and booted to safe mode as normal
    mode didn't open.soon after 20 mins I restarted my lap and I received an error 0xc000021a bios and windows booted.i then pressed power button for a min and switched on my pc but it showed a different error 0xc00000e9. I restarted many times
    either 0xc000021a or 0xc00000e9 used to come not an fixed error. I don't have my cd as it got scratches on CD.  Plzz help me to get out of this problem.
    I can't even access my laptop and I am using my windows phone to post this.

  • Blue Screen of Death - Memory Management

    I have gotten the blue screen of death twice now. The screen went by really fast but I think it said something about memory, like memory management. I copied the problem details:
    Problem signature:
    Problem Event Name: BlueScreen
    OS Version: 6.1.7601.2.1.0.768.3
    Locale ID: 4105
    Additional information about the problem:
    BCCode: 1a
    BCP1: 0000000000041790
    BCP2: FFFFFA80022B8DF0
    BCP3: 000000000000FFFF
    BCP4: 0000000000000000
    OS Version: 6_1_7601
    Service Pack: 1_0
    Product: 768_1
    Files that help describe the problem:
    C:\Windows\Minidump\071314-34335-01.dmp
    C:\Users\Tiffany Jiang\AppData\Local\Temp\WER-53804-0.sysdata.xml
    Both times happened randomly and about 2 weeks apart, and the laptop (Toshiba Satellite; it was bought brand new about only 3 weeks ago) still works fine after it restarts, but I don't want it to keep happening. I also don't know what the problem is. I used my previous Windows 7 laptop (HP pavillion g6) the same way for 3 years and it never blue screened even once. I tried going to the Toshiba support website to see if I need to download any new drivers but the website does not seem to be working on my laptop, everytime I go on it it's just lines of letter and numbers.
    Help would be much appreciated, thank you!

    Satellite C55-A5195
    Downloads here.
    Bug Check 0x19: BAD_POOL_HEADER
    Caused By Driver  : vsdatant.sys              <- True Vector device driver
    You have ZoneAlarm on board? If so, uninstall it and see what happens. 
    ==================================================
    Dump File         : 071314-34335-01.dmp
    Crash Time        : 7/15/2014 9:58:18 AM
    Bug Check String  : MEMORY_MANAGEMENT
    Bug Check Code    : 0x0000001a
    Parameter 1       : 00000000`00041790
    Parameter 2       : fffffa80`022b8df0
    Parameter 3       : 00000000`0000ffff
    Parameter 4       : 00000000`00000000
    Caused By Driver  : ntoskrnl.exe
    Caused By Address : ntoskrnl.exe+75bc0
    File Description  :
    Product Name      :
    Company           :
    File Version      :
    Processor         : x64
    Computer Name     :
    Full Path         : C:\Test\071314-34335-01.dmp
    Processors Count  : 4
    Major Version     : 15
    Minor Version     : 7601
    ==================================================
    ==================================================
    Dump File         : 070514-42837-01.dmp
    Crash Time        : 7/15/2014 9:58:18 AM
    Bug Check String  : BAD_POOL_HEADER
    Bug Check Code    : 0x00000019
    Parameter 1       : 00000000`00000020
    Parameter 2       : fffffa80`0b390140
    Parameter 3       : fffffa80`0b390160
    Parameter 4       : 00000000`04020008
    Caused By Driver  : vsdatant.sys
    Caused By Address : vsdatant.sys+47054
    File Description  :
    Product Name      :
    Company           :
    File Version      :
    Processor         : x64
    Computer Name     :
    Full Path         : C:\Test\070514-42837-01.dmp
    Processors Count  : 4
    Major Version     : 15
    Minor Version     : 7601
    ==================================================
    -Jerry

  • Memory Management Error in Windows 8.1

    please check dumpfile in this url related to memory management error in windows 8.1. This error usually occurs when i open window  media player....thanks
    https://skydrive.live.com/redir?resid=99B960292878F11C%21148

    These crashes were related to memory management (probably caused by a driver). 
    Please run these tests to verify your memory and find which driver is causing the problem.  
    If you are overclocking (pushing the components beyond their design) you should revert to default at least until the crashing is solved. If you don't
    know what it is you probably are not overclocking.
    1-Memtest. (You can read more about running memtest here)
    2-Driver verifier (for complete directions see our wiki here)
    Co-Authored by  JMH3143
    Wanikiya and Dyami--Team Zigzag

  • Java Memory Management/Out of Memory

    Hi Guys,
    I have a few questions about java memory management
    Because i keep encounter a lot of out of memory error which i think java does not handle Vector/ArrayList re initialisation automatically
    Asumme i have 2 million record in database and , i will process every 80000 and store it in Vector
    while(true)
    list = new Vector();
    list = GetResultFromDatabase() // Process Every 80000
    if list.size() > 0 =======> My VEctor list contain 80000
    //loop the 800000
    //Process Some logic and data
    list.clear();
    list = null;
    If u See , i need to call list.clear and list = Null every process so it wont cause me out of memory
    Before i put that 2 lines , i always hit out of memory Exception.
    Seems like garbage collector cannot claim memory if i dont declare
    Is Memory Occupied by VEctor cannot be recoverable if we dont explitcitynya clear it and set it to NULL??
    Because in term of logic wise it wont cause a problem if i just
    do in this statement after it process like below
    list = new Vector() which will reinstatiate the object.
    Thanks.

    Damm i should hacve read your post again
    Look here:
    while(true)
    list = new Vector();What uer doing is craeting a new vector object everytime the while does an ityteration so when your while loop does 40000 loops there will be 40000 new objects in jou memory
    i sugest moving the decleration outside the while loop:
      list = new Vector();
    while(true)
    ///rest of loop
    } This could also be a problem
    hope it help :-)
    werns

  • How does object memory management works?

    Hi all,
    I'm having a lot of problems with memory which seems not to be released when using objects (on Oracle 9i 9.0.1.1.1). I've prepared the following test:
    create type t_test as object (
    id number,
    member function FunctTest(TBL IN CHAR, expand IN CHAR) return varchar2
    ) not final;
    create or replace type body t_test as
    MEMBER FUNCTION FunctTest(TBL IN CHAR, expand IN CHAR) RETURN varchar2 IS
    BEGIN
    return NULL;
    END FunctTest;
    end;
    create or replace function FunctTest2(TBL IN CHAR, expand IN CHAR) RETURN varchar2 IS
    BEGIN
    return NULL;
    END FunctTest2;
    create table tab_test of t_test;
    insert into tab_test values(1);
    commit;
    As you can see, I create a simple type with a member function, and a schema function who does the same (nothing, in this case). Then I call the two functions with the following PL/SQL blocks:
    declare i integer;
    t varchar2(4000);
    ob t_test;
    begin
    select value(a) into ob from tab_test a where a.id=1;
    for i in 1..5000 loop
    select ob.FunctTest('A','S') into t from dual;
    end loop;
    end;
    declare i integer;
    t varchar2(4000);
    begin
    for i in 1..5000 loop
    select FunctTest2('A','S') into t from dual;
    end loop;
    end;
    If you run these blocks with Task Manager opened (I use W2000) on server console, you can see how memory usage grows very fast with the first block, and how it doesn't change with the second one.
    The memory isn't released till the session is alive.
    I'm trying to develop an object application, but these memory leaks are making me crazy.
    Geoff, does release 2 solve some of these problems?
    In particular, please, do I need to free by myself temporary objects (these ones referenced in PL/SQL blocks)? In which way? I haven't found anything about object memory management in documentation...
    As always,
    Thanks for any support to everybody.
    Andrea Arilotta
    [email protected]

    Andrea,
    Do you have an Oracle Support customer ID? If you can log a TAR on http://metalink.oracle.com with your customer id, someone can take a closer look at this problem.
    Regards,
    Geoff
    Hi all,
    I'm having a lot of problems with memory which seems not to be released when using objects (on Oracle 9i 9.0.1.1.1). I've prepared the following test:
    create type t_test as object (
    id number,
    member function FunctTest(TBL IN CHAR, expand IN CHAR) return varchar2
    ) not final;
    create or replace type body t_test as
    MEMBER FUNCTION FunctTest(TBL IN CHAR, expand IN CHAR) RETURN varchar2 IS
    BEGIN
    return NULL;
    END FunctTest;
    end;
    create or replace function FunctTest2(TBL IN CHAR, expand IN CHAR) RETURN varchar2 IS
    BEGIN
    return NULL;
    END FunctTest2;
    create table tab_test of t_test;
    insert into tab_test values(1);
    commit;
    As you can see, I create a simple type with a member function, and a schema function who does the same (nothing, in this case). Then I call the two functions with the following PL/SQL blocks:
    declare i integer;
    t varchar2(4000);
    ob t_test;
    begin
    select value(a) into ob from tab_test a where a.id=1;
    for i in 1..5000 loop
    select ob.FunctTest('A','S') into t from dual;
    end loop;
    end;
    declare i integer;
    t varchar2(4000);
    begin
    for i in 1..5000 loop
    select FunctTest2('A','S') into t from dual;
    end loop;
    end;
    If you run these blocks with Task Manager opened (I use W2000) on server console, you can see how memory usage grows very fast with the first block, and how it doesn't change with the second one.
    The memory isn't released till the session is alive.
    I'm trying to develop an object application, but these memory leaks are making me crazy.
    Geoff, does release 2 solve some of these problems?
    In particular, please, do I need to free by myself temporary objects (these ones referenced in PL/SQL blocks)? In which way? I haven't found anything about object memory management in documentation...
    As always,
    Thanks for any support to everybody.
    Andrea Arilotta
    [email protected]

  • Resizing an array of struct inside a DLL using the memory manager

    Hi all,
    I dug deep inside the boards, but wasn't able to find a solution for my problem.
    I'm building a dll, which does some imageprocessing and should return an array of structs to labview, with one struct for every element in the image.
    As I don't know the number of elements beforehand and the limit of the number is numbers of magnitude larger then the expected one, I don't want to allocate such a huge chunk of memory prior to the dll call in labview.
    In a former version I used a 2d array for the elements, where each row holds the values of every element. Here I used the NumericArrayResize-function, which worked quite well. But I have to add more sub-processes and using structs (or clusters in labview) appears to be more usefull and cleaner for me, in addition I had to cast some of the elements back and foreward a few times.
    So one element-struct should hold 2 singles and 1 uint32. My question is now, how can I resize this array of struct with memory manager functions as the NumericArrayResize-functions does not suit this purpose?
    (Accessing a given array of structs inside the DLL and after that reading the changed values in Labview is surprisingly easy )
    Thanks in advance
    Solved!
    Go to Solution.

    Well, I was able to solve it myself. I found this thread, where the first post of rolfk made me thinking. It appeared to me, that the numericarrayresize-function behaves very similar to the realloc-function of c. So I used the type unsigned int 8 (which is just one byte) and multiplied it by the number of bytes used by one struct, in my case 12 bytes (4+4+4) and then multiplied it by the number of structs (elements in the image) i have. Luckily it worked and the memory block was resized exactly as I wanted it to be. Important to note: do not forget to adjust the size element of the handle, otherwise Labview does not know about the changed size.

  • Oracle 9i Automatic PGA Memory Management

    Hello,
    my team and me, we are facing difficulties to change the size of the PGA used by our server processes for HASH JOIN, SORT... operators,
    here you can see the results of "select * from v$pgastat":
    [pgastat dynamic view results|http://pastebin.com/m210314dc]
    We have been increasing consecutively our pga_aggregate_target parameter from 1.7 Gb initially to 4Gb then at the end 6Gb, the value of "Global memory bound" and " aggregate pga auto target" on the link above are still equal to 0.
    I have been reading threads on the forum and documentation see below, I understand how the global memory manager (CKPT) computest the sql memory target and then the global memory bound, as far as I understand I can only "play" on the pga_aggregate_target value in order to increase the size of our PGAs (I exclude to play with hidden parameters).
    - Joze Senegacnik: Advanced Management of working areas in Oracle 9i/10g : http://tonguc.yilmaz.googlepages.com/JozeSenegacnik-PGAMemoryManagementvO.zip
    - Dageville Benoit and Zait Mohamed: SQL memory management in oracle 9i
    Here different information that could be usefull:
    OS: solaris 10 (db running in a non global zone)
    Arch: 64-bit sparcv9 kernel modules
    Physical memory: 32 Gb (being shared between all non global zones)
    Oracle version: 9.2.0.5 32bits
    Values of init parameters and hidden parameters that could be relevant:
    [init parameters|http://pastebin.com/m40340cf4]
    [hidden parameters|http://pastebin.com/m50d74c53]
    Maybe useful queries:
    over work areas views, I use the following script:
    [wa_analysis.sql|http://pastebin.com/d606ebd9b]
    and the result of it:
    [result of script wa_analysis.sql|http://pastebin.com/m5f49a2e5]

    Joze Senegacnik wrote:
    - either your sessions are using a lot of memory for storing variables like pl/sql arrays which is subtracted from automatic management: PGA_AGGREGATE_TARGET - (aggregated persistent area + a part of the run time area of all server processes)
    - you are hitting a bug
    - or maybe something elseI am really happy you come to this conclusion too, they are the same we made with my team and we have submitting to Oracle support via metalink SR 3-1216060641, we were asking if we hit the following bug (in note 1) or we leak about pl/sql or java... or else indeed,
    note 1: PGA_AGGREGATE_TARGET Assigned Memory Is Left Unconsumed When Set High [ID 844542.1]
    Joze Senegacnik wrote:
    I would like to know:
    1.) what were the values for global memory bound and autotarget immediately (or in short time) after the database restart or when you have increased them Just after the restart of the database and just after the change of P_A_T, we query v$pgastat immediately after and the value of global memory bound and auto target were equal to 0 byte,
    2.) If you are able to change value of PGA_AGGREGATE_TARGET (P_A_T) to 10GB what happens with global memory bound and auto traget. They should be positive at least for a short time. As this is a dynamic parameter you can change it for a short time, run queries and set it back.We plan to do this tonight, we have an "heavy" ITIL change management procedures that allow us to make changes approved by change manager and only during night maintenance window on production system, I come back to you tomorrow. But we have been increasing from 1,7Gb to 4Gb to 6Gb, each time I have been querying v$sgastat in the next 2 mins and global memory bound and auto target were equal to 0 byte.
    3.) Have you checked on the OS level how much memory are using server processes - do these numbers come along with what Oracle says. Not during problematic activities, meaning active work areas performing HASH-JOIN, SORT... operators,
    unfortunately it is a production system, even if he performs poorly, we are not allowed to try or retry the poor queries, but if it comes again I'll do it,
    during low activities, here the results paste with the scripts I used:
    [pga processes info in oracle|http://pastebin.com/f2e540062]
    I spooled the result rows of this previous script in /var/tmp/pga_processes.log then I loop over all processes pid and display pmap output anon info like this:
    h5. cat /var/tmp/pga_processes.log | awk -F' ' '{print $5}' | xargs -n 1 -i pmap -x {}| grep -v 'Addres' |egrep 'Kb' 2>&1 > /var/tmp/pga_processes_os.log
    then I merge line by line the two files with unix paste command, here the results:
    [os and oracle pga informations|http://pastebin.com/f4135c8a6]
    4.) How many server processes are running on you system in average/max and are you using just dedicated processes or also shared?in average 250, we are only using dedicated processes,
    5.) At time of low activity is the global memory bound still 0 or becomes > 0. I have been querying every 15 min during more than 24 hours low activities, it still stay to 0,
    5.) Are you experiencing paging/swapping on OS level?No, here orca figures for details:
    [free memory|http://img509.imageshack.us/img509/5897/ohuron1asd2gauge1024xfr.png]
    swap
    [pagein pageout|http://img121.imageshack.us/img121/6946/ohuron1asd2gaugepginper.png]
    [memory usage|http://img19.imageshack.us/img19/2213/ohuron1asd2gaugeppkerne.png]
    6.) Please post the result of: select * from X$QESMMSGA ;during low activities, [results X$QESMMSGA|http://pastebin.com/f61df7093]
    While you will be answering to my questions I'll try to figure out what we can do to properly diagnose the problem. As you are on 9i it is a little bit harder.I am really kind of your help, as we say in my country, "if you need tow arms one day to carry something, call me."
    --Jeremy Baumont                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Memory increase problem on Solaris

    We need your help in understanding and solving a memory problem in one of our products running on Soalris. The server memory keeps growing and there is a fear of a server crash.
    We've run our product with Purify and libumem to identify memory leaks. Both of these products didn't report any leak. So, we are very much confident that there are no memory leaks in the product. Still the memory increase is seen on Unix systems. We've done extensive analysis on this subject and absorbed some key points regarding memory management in Unix.
    1) Memory doesn't shrink on Unix systems. This is for the libc to retain the released memory and reuse it for further memory requirements.
    2) Based on the memory requirements to our application there can be a stabilization point where in the application can serve all memory requests.
    After reaching this point the Server memory doesn't increase.But the fear is that it may exceed the hardware resources constraint.
    3) Rapid increase in memory can be because of Memory Fragmentation problem. There are environmental variables like Small Block Allocator (_M_SBA_OPTS) and Arena (_M_ARENA_OPTS) on HP-Unix machines which can be used to address Fragmentation issues. We've performed some tests using these variables and found significant improvement in the usage of memory. This confirms that there are no memory leaks. These variables are specific to HP-Unix machines and we are unaware of similar variables/mechanism on Sun Solaris Platform. Please recommend some environmental variables/mechanism on Sun Solaris platform to solve fragmentation problem.
    We are performing some tests to observe memory stabilization over a period of time .
    The memory bloat is following a pattern. Memory is increasing in chunks of (MB) 2,4,8,16,32,64,128,256,512,1024 MB pattern.
    For example if Memory increase is 64 MB, then it stabilizes for some time and the next increase would be 128 MB at a time.
    Then it stabilizes for double the time consumed earlier for 64 MB and after that only increases by 256 MB.
    So the memory increase and stabilization time are getting doubled each time. Please validate our analysis and kindly suggest what can be done on Unix platforms for solving this memory increase problem.

    Thanks MaximKartashev for your inputs.
    Ours is a Multithreading application. We are testing it with Hoard for the last three days. The observation so far has been that the performance of Hoard is high but the bloat pattern is not avoided.
    Even with Hoard, memory bloat is following a pattern. Memory is increasing in chunks of (MB) 2,4,8,16,32,64,128,256,512,1024 MB pattern.
    We are searching for other ways to control this pattern and stabilize the application by making it to reuse the fragmented memory completely.
    We have also tried Solaris libgc memory allocator (http://developers.sun.com/solaris/articles/libgc.html). It worked well initially and memory drop was seen. But on heavy load, it crashed the application with 'Can't allocate header' error. So this can't be used for heavy load.
    We are trying to use Boehm-Demers-Weiser Garbage Collector (http://www.hpl.hp.com/personal/Hans_Boehm/gc/). Do any one have idea, if it controls memory fragmentation ?

Maybe you are looking for

  • Can't delete files from iTunes File Sharing

    iPad, IOS 8.1.3 MacBook Pro Retina, OS 10.10.2 iTunes, v12.1 I'm trying to delete files from iTunes. In this instance, I have files I made in Pages, via my iPad, I have learned how to move them to my computer without using iCloud, which I prefer. Now

  • How do we control who can approve items in a list?

    We are building a referral bonus list that needs to go through 4 levels of approval before being paid out.  I've created the workflow, but I can't figure out how to control who is allowed to approve it.  For example, it would be bad if an employee ca

  • Are you inviting us to discuss BT's challenge to t...

    Kerry G wrote: http://community.bt.com/t5/Announcements/The-buzz-around-BT-and-The-Digital-Economy-Act/m-p/27335#M3... The buzz around BT and The Digital Economy Act  Hi everyone Perhaps if you've read the news, you'll know that BT is legally challen

  • Scheduling ddl in a trigger

    Hi, I'm trying to find a way to schedule DDL statements from Oracle triggers. As one example, we keep INDEX metadata in our own IndexMetadata table. I'm trying to create a row delete trigger on this table that will schedule a (dynamic) DROP INDEX sta

  • Journal in iCloud, not on iPad

    When I updated to iOS 6, it didn't go well, so I ended up doing a restore to factory settings. The journal I had made is still in iCloud, but (of course) it's no longer on my iPad. Is there a way to download it back to my iPad?