Memory management count

Hello all,
I have a general inquiry on keeping the memory count in regards to memory management. Suppose my set routine is this (which I believe is the general set routine, save for checking that the new input does not equal the current value):
-(void)setVariable:(id)newValue{
[[variable release]];
[[newValue retain]];
Variable = newValue;
1. Assuming 'newValue' has not been retained or allocated elsewhere, it's count here is 1. Is that right?
2. Is the count of 'variable' also 1? We didn't actually retain 'variable'. But what it's pointing to is retained. I am unsure how the count is kept. Who get's the extra 1? 'variable' or 'newValue'?
Message was edited by: rpstro02
Message was edited by: rpstro02

Keep in mind that the variables you're dealing with here are pointers to objects. And that it's the actual objects that have a retainCount, not the pointers.
So when you do:
[newValue retain];
... it's whatever object newValue is pointing to that gets an incremented retainCount... not the newValue pointer itself.
Then when you do:
variable = newValue;
... now you've just made your "variable" pointer point to the _same object_ that newValue is pointing to. There's only one retainCount involved. So there is not an "extra 1" if I'm understanding that part of your question correctly.
Steve

Similar Messages

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

    Hello All!
    I read the Memory Management Programming Guide for Cocoa - several times. But some things are still not really clear.. I would like and need to have a deeper understanding. So, I hope someone could help me The problem is that I had to get rid of several (..) memory leaks in my app, and now I am a bit confused and unsure about my skills at all..
    1.
    What is the difference between sayHello1,sayHello2,getHello1,getHello2,getHello3 and which one is "better" (and why) - please dont try to interprete the logic/sense of the methods itself
    - (NSString *) sayHello1{
    return [[[NSString alloc] initWithString:@"Hello"] autorelease];
    - (NSString *) sayHello2{
    return [[[NSString alloc] initWithString:@"Hello"] retain];
    - (void) getHello1{
    NSString *hello = [self sayHello1];
    [hello release];
    - (void) getHello2{
    NSString *hello = [self sayHello2];
    [hello release];
    - (void) getHello3:(NSString *)hello{
    [hello retain];
    NSLog(@"%@", hello);
    [hello release];
    Concerning this, there are several questions:
    2.
    If I have to release everything I retain/alloc, why then do I have a memory leak, if am returning an object (which was allocated with alloc and init) from a method without autorelease. The object is still in memory. But the following method wont work. What I accept. But the object is, if returned, not reachable, but also not released. Why then is it not automatically released? (i dont mean autorelease)
    - (NSString *) sayHello1{
    return [[NSString alloc] initWithString:@"Hello"]];
    - (void) getHello{
    NSString *hello = [self sayHello1]; //wont work. the object is not there, but also not released. WHERE is it?
    [hello release];
    3.
    When is a delegate method released, if I have no variable I can use to "release"? So, if I have nothing to access the delegate like a NSURLConnection delegate?
    should I, for example, call a [self release]?
    - (void)startParser{
    Parser *parser = [[Parser alloc] init];
    [parser start];
    //should I use a [parser autorelease or retain] here?
    - (void)parserDidEndDocument:(NSXMLParser *)parser{
    //do somethings with the parserstuff
    [self release];
    4.
    *And the last question:*
    Where can I see in instruments, which elements have retain counts > 1 and potential leaks? I was reading the instruments guide but there is only theoretical stuff. No practical guides like: your app should not have/use more than x megabyte ram.. for example: my app gets slower and slower the longer a i use it. -> this indicates memory leaks..

    A Leak is only a leak if the reference to the object is lost.
    https://devforums.apple.com/message/189661#189661

  • Memory Manager - Connection Memory keeps increasing

    I have a SQL Server 2008 R2 SP2 STD with SQL and SSAS
    running on 16 GB memory and Win 2008 R2 64 BIT, at the beginning, the Memory
    Manager -> Database Memory takes most of the SQL used memory, but the Memory
    Manager -> Connection Memory counter keeps increasing until it consumes
    almost all memory after about a week. I have to restart SQL server to release
    the memory used by Connection Memory.
    Is there a way to release the
    Connection Memory? Or how to know which connections are using all the
    memory?
    Thanks in advance.

    Hi,
    You can use sys.dm_exec_sessions view to check the connection and current requests of the program and login name.
    For more information:
    sys.dm_exec_sessions (Transact-SQL)
    http://msdn.microsoft.com/en-us/library/ms176013.aspx
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Anyone use nio-memory-manager ?? what's it good for?

    Can someone give me an example of when the nio-memory-manager should be used?
    Thanks,
    Andrew

    If I remember the outcome of my experiments with NIO right the situation is as follows:
    1. Allocating/releasing huge shared memory blocks over and over can lead to OS/JVM issues. To avoid this I allocated the max size I wanted from the start (this is an option when configuring "off-heap" storage I believe). When doing it this way I had no reliability issues with the NIO memory manager in my tests.
    2. Tangosol/Oracle used to claim that the off-heap (NIO memory manager) result in worse performance than on-heap - I could not see any clear indication of this but this may be application dependent. For our app the reduced number of JVM:s per server (reducing network communication, number of threads, risk of any JVM performing GC at a given time etc etc) seemed to more than offset the allegedly slower memory manager resulting in MUCH BETTER performance! A lot of queries etc anyhow (at least for us) mainly work against indexes that always are stored "on-heap"...
    3. There is a limitation to 2Gb per NIO block (at least in 32-bit JVM:s not sure about 64:bit - never seen any point in using them since larger heaps than 2Gb seldom work well anyhow and each pointer consumes double the space in heap and CPU-caches) but this is for each CACHE and separate for PRIMARY and BACKUP I believe! So my understanding is that if you (using 64-bit OS) for instance have two (equally big) caches you could allocate max 2 * 2 * 2 = 8Gb of off-heap memory for folding data per JVM (without ANY impact on GC-pauses!) and in addition to that use as much heap as you can get away with (given GC-pause times) for holding the indexes to that data. This would makes a huge difference in JVM count!- for example we today have to run like 10+ JVM:s per server using "on-heap" while we using "off-heap" storage probably could get that down to one or two JVM:s per server!
    4. There may be both OS and JVM parameter that you need to set (depending on OS and JVM used!) in order to allocate large amounts of shared memory using NIO (the default is rather small).
    As for the question about de-allocation I never saw any sign of memory leaks with the NIO memory manager (i.e. space previously occupied by deleted objects were reused for new objects) but as I mentioned above you better allocating the max size NIO memory block you intend to use up-front and that memory will then remain allocated for this use so if your amount of cache data vary and you would like to use memory for other purposes (like heap!) at some point you may be better of sticking with "on-heap" that is more flexible in that respect.
    As I previously mentioned off-heap is today (until Oracle fixes the improvement request!) really only an option if you do not plan to use "overflow protection" or your objects are fixed size :-(
    And if you are interested in using servers with a lot of memory and would like to use "off-heap" please talk to your Oracle sales rep about it! If enough people do that it may allow the Coherence developers to assign more time for making "off-heap" storage better! With this feature in place Coherence will be even more of a "killer application" than it already is!
    Best Regards
    Magnus

  • What is difference between 32 bit and 64 bit sql server memory management

    What is difference between 32 bit and 64 bit sql server memory management
    Thanks
    Shashikala

    This is the basic difference...check if helps:
    A 32-bit CPU running 32-bit software (also known as the x86 platform) is so named because it is based on an architecture that can manipulate values that are up to 32 bits in length. This means that a 32-bit memory pointer can store a value between 0 and
    4,294,967,295 to reference a memory address. This equates to a maximum addressable space of 4GB on 32-bit platforms
    On the other hand 64-bit limit of 18,446,744,073,709,551,616, this number is so large that in memory/storage terminology it equates to 16 exabytes. You don’t come across that term very often, so to help understand the scale, here is the value converted to
    more commonly used measurements: 16 exabytes = 16,777,216 petabytes (16 million PB)➤ 17,179,869,184 terabytes (17 billion TB)➤ 17,592,186,044,416 gigabytes (17 trillion GB)➤
    As you can see, it is significantly larger than the 4GB virtual address space usable in 32-bit systems; it’s so large in fact that any hardware capable of using it all is sadly restricted to the realm of science fiction. Because of this, processor manufacturers
    decided to only implement a 44-bit address bus, which provides a virtual address space on 64-bit systems of 16TB. This was regarded as being more than enough address space for the foreseeable future and logically it’s split into an 8TB range for user mode
    and 8TB for kernel mode. Each 64-bit process running on an x64 platform will be able to address up to 8TB of VAS.
    Please click the Mark as answer button and vote as helpful if this reply solves your problem

  • Questions about db_keep_cache_size and Automatic Shared Memory Management

    Hello all,
    I'm coming upon a server that I'm needing to pin a table and some objects in, per the recommendations of an application support call.
    Looking at the database, which is a 5 node RAC cluster (11gr2), I'm looking to see how things are laid out:
    SQL> select name, value, value/1024/1024 value_MB from v$parameter
    2 where name in ('db_cache_size','db_keep_cache_size','db_recycle_cache_size','shared_pool_size','sga_max_size');
    NAME VALUE VALUE_MB
    sga_max_size 1694498816 1616
    shared_pool_size 0 0
    db_cache_size 0 0
    db_keep_cache_size 0 0
    db_recycle_cache_siz 0 0
    e
    Looking at granularity level:
    SQL> select granule_size/value from v$sga_dynamic_components, v$parameter where name = 'db_block_size' and component like 'KEEP%';
    GRANULE_SIZE/VALUE
    2048
    Then....I looked, and I thought this instance was set up with Auto Shared Mem Mgmt....but I see that sga_target size is not set:
    SQL> show parameter sga
    NAME TYPE VALUE
    lock_sga boolean FALSE
    pre_page_sga boolean FALSE
    sga_max_size big integer 1616M
    sga_target big integer 0
    So, I'm wondering first of all...would it be a good idea to switch to Automatic Shared Memory Management? If so, is this as simple as altering system set sga_target =...? Again, this is on a RAC system, is there a different way to do this than on a single instance?
    If that isn't the way to go...let me continue with the table size, etc....
    The table I need to pin is:
    SQL> select sum (blocks) from all_tables where table_name = 'MYTABLE' and owner = 'MYOWNER';
    SUM(BLOCKS)
    4858
    And block size is:
    SQL> show parameter block_size
    NAME TYPE VALUE
    db_block_size integer 8192
    So, the space I'll need in memory for pinning this is:
    4858 * 8192 /1024/1024 = 37.95.......which is well below my granularity mark of 2048
    So, would this be as easy as setting db_keep_cache_size = 2048 with an alter system call? Do I need to set db_cache_size first? What do I set that to?
    Thanks in advance for any suggestions and links to info on this.
    cayenne
    Edited by: cayenne on Mar 27, 2013 10:14 AM
    Edited by: cayenne on Mar 27, 2013 10:15 AM

    JohnWatson wrote:
    This is what you need,alter system set db_keep_cache_size=40M;I do not understand the arithmetic you do here,select granule_size/value from v$sga_dynamic_components, v$parameter where name = 'db_block_size' and component like 'KEEP%';it shows you the number of buffers per granule, which I would not think has any meaning.I'd been looking at some different sites studying this, and what I got from that, was that this granularity gave you the minimum you could set the db_keep_cache_size, that if you tried setting it below this value, it would be bumped up to it, and also, that each bump you gave the keep_cache, would be in increments of the granularity number....?
    Thanks,
    cayenne

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

  • 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

  • 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

  • RE: (forte-users) memory management

    Brenda,
    When a partition starts, it reserves the MinimumAllocation. Within this
    memory space, objects are created and more and more of this memory is
    actually used. When objects are no longer referenced, they remain in memory
    and the space they occupy remains unusable.
    When the amount of free memory drops below a certain point, the garbage
    collector kicks in, which will free the space occopied by all objects that
    are no longer referenced.
    If garbage collecting can't free enough memory to hold the additional data
    loaded into memory, then the partition will request another block of memory,
    equal to the IncrementAllocation size. The partition will try to stay within
    this new boundary by garbage collecting everytime the available part of this
    memory drops below a certain point. If the partition can't free enough
    memory, it will again request another block of memory.
    This process repeats itself until the partition reaches MaximumAllocation.
    If that amount of memory still isn't enough, then the partition crashes.
    Instrument ActivePages shows the memory reserved by the partition.
    AllocatedPages shows the part of that memory actually used.
    AvailablePages shows the part ot that memory which is free.
    Note that once memory is requested from the operating system, it's never
    released again. Within this memory owned by the partition, the part actually
    used will always be smaller. But this part will increase steadily, until the
    garbage collecter is started and a part of it is freed again.
    There are some settings that determine when the garbage collector is
    started, but I'm not sure which ones they are.
    The garbage collector can be started from TOOL using
    "task.Part.OperatingSystem.RecoverMemory()", but I'm not sure if that will
    always actually start the garbage collector.
    If you track AllocatedPages of a partition, it's always growing, even if the
    partition isn't doing anything. I don't know why.
    If you add AllocatedPages and AvailablePages, you shoud get the value of
    ActivePages, but you won't. You always get a lower number and sometimes even
    considerably lower. I don't know why.
    Pascal Rottier
    Atos Origin Nederland (BAS/West End User Computing)
    Tel. +31 (0)10-2661223
    Fax. +31 (0)10-2661199
    E-mail: Pascal.Rottiernl.origin-it.com
    ++++++++++++++++++++++++++++
    Philip Morris (Afd. MIS)
    Tel. +31 (0)164-295149
    Fax. +31 (0)164-294444
    E-mail: Rottier.Pascalpmintl.ch
    -----Original Message-----
    From: Brenda Cumming [mailto:brenda_cummingtranscanada.com]
    Sent: Tuesday, January 23, 2001 6:40 PM
    To: Forte User group
    Subject: (forte-users) memory management
    I have been reading up on memory management and the
    OperatingSystemAgent, and could use some clarification...
    When a partition is brought online, is the ActivePages value set to the
    MinimumAllocation value, and expanded as required?
    And what is the difference between the ExpandAtPercent and
    ContractAtPercent functions?
    Thanks in advance,
    Brenda
    For the archives, go to: http://lists.xpedior.com/forte-users and use
    the login: forte and the password: archive. To unsubscribe, send in a new
    email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com

    The Forte runtime is millions of lines of compiled C++ code, packaged into
    shared libraries (DLL's) which are a number of megabytes in size. The
    space is taken by the application binary, plus the loaded DLL's, plus
    whatever the current size of garbage collected memory is.
    Forte allocates a garbage-collected heap that must be bigger than the size
    of the allocated objects. So if you start with an 8MB heap, you will always
    have at least 8MB allocated, no matter what objects you actually
    instantiate. See "Memory Issues" in the Forte System Management Guide.
    -tdc
    Tom Childers
    iPlanet Integration Server Engineering
    At 10:37 PM 6/11/01 +0200, [email protected] wrote:
    Hi all,
    I was wondering if anyone had any experience in deploying clients on NT
    concerning
    the memory use of these client apps.
    What is the influence of the various compiler options (optimum
    performance, memory use etc)?
    We seem to see a lot of the memory is taken by the Forte client apps (seen
    in the Task Manager
    of NT) in respect to the other native Window apps. For example an
    executable of approx 4Mb takes up to
    15Mb of memory. When I look at the objects retained in memory after
    garbage collection, these are about
    2Mb. Where do the other Mb's come from?

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

  • Difference between nio-file-manager  and nio-memory-manager

    Hi,
    what's the difference between nio-file-manager and nio-memory-manager? The documentation doesn't really discuss the differences as far as I know. They both use nio to store memory-mapped files don't they? What are the advantages/disadvantages of both?
    When to choose the first one and when the second when storing a large amount of data? Can both be used to query data with the Filter API? Are there size limits on both?
    Best regards
    Jan

    Hi Jan,
    The difference is that one uses a memory mapped file and one uses direct nio memory (as part of the memory allocated by the JVM process) to store the data. Both allow storing cache data off heap making it possible to store more data with a single cache node (JVM) without long GC pauses.
    If you are using a 32 bit JVM, the JVM process will be limited to a total of ~3GB on Windows and 4GB on Linux/Solaris. This includes heap and off heap memory allocation.
    Regarding the size limitations for the nio-file manager Please see the following doc for more information.
    With the release of 3.5 there is now the idea of a Partitioned backing map which helps create larger (up to 8GB of capacity) for nio storage. Please refer to the following doc.
    Both can be used to query data but it should be noted that the indexes will be stored in heap.
    hth,
    -Dave

Maybe you are looking for