Dynamic memory allocation failure

Dear reader,
We sometimes have a problem where our windows 2012 r2 RDS virtual servers, that reside on windows 2012r2 hyper-v hosts, loose their dynamic memory and only have their startup memory left to work with. Users start complaining that things are very slow etc.
If I check several screens (RDS Broker load balancing, hyper-v manager, cluster manager and the vm's task manager) it's clear that the vm only has its startup memory allocated. I'm not sure if this happens instantly or immidiatly after the nightly reboot.
To resolve the problem we have to call all users on the vm where it happens and ask them to logoff (if they are even able to), and then we reboot the machine.
I have checked the logs from the machine where the VM resides on and the logs from the vm itself. But I cannot find anything. We also have alot of windows 2008r2 vm's with dynamivc memory, but none of those have ever had this problem.
Searched the internet, but so far it seems we are only.
Can anyone give me a lead to troubleshoot this?
Best regards,
Ruud Boersma
MCITP Enterprise administrator

Hi all,
I'm going to be "one of those people" who revives dead posts for something that is relevant but obviously not fixed... sorry in advance!
We have the exact same situation, a bunch of RDSH guests with Dynamic memory turned on (60+ of them). every day between 1-8 of them will fail to allocate Dynamic memory and will be stuck on their startup RAM amount. This really hurts our users at peak
times.
I have engaged our TAM and have raised a case with PSS, Usual story "your the only one with this problem". Which obviously isn't true.
So, we have tons of free RAM on the hosts, 600GB+ on most of them, the issue affects RDSH hosts at random, across multiple hosts and clusters.
The screen shots attached are of one of our hosts from this morning. it has 8GB startup, 8GB minimum, 32GB Maximum RAM configured, with a 23% buffer. the host has 752GB RAM FREE. Notice how the perf counter "Hyper-V Dynamic Memory Integration Service"
is reporting "0", it should be reporting "32768". also under task manager on the VM we are missing "Maximum memory" which should be just below "Hardware reserved" in the bottom right hand corner.
Looks like the balloon driver is being delayed at boot time, we are going to XPerf all the servers in the hope that we can catch the critter. It's an unusual problem.
We only have Acrobat PDF viewer, word viewer, excel viewer and two custom dot.NET applications installed on the guests. Some of the servers are also just dumb RDSH hosts, with not connection broker configured, using an F5 loadbalancer for load distribution
and session management. All guests are 2012R2 patched up to March 2015, integration Services are installed and up to date (its an enlightened OS remember).

Similar Messages

  • Templates and Dynamic Memory Allocation Templates

    Hi , I was reading a detailed article about templates and I came across the following paragraph
    template<class T, size_t N>
    class Stack
    T data[N]; // Fixed capacity is N
    size_t count;
    public:
    void push(const T& t);
    };"You must provide a compile-time constant value for the parameter N when you request an instance of this template, such as *Stack<int, 100> myFixedStack;*
    Because the value of N is known at compile time, the underlying array (data) can be placed on the run time stack instead of on the free store.
    This can improve runtime performance by avoiding the overhead associated with dynamic memory allocation.
    Now in the above paragraph what does
    "This can improve runtime performance by avoiding the overhead associated with dynamic memory allocation." mean ?? What does template over head mean ??
    I am a bit puzzled and i would really appreciate it if some one could explain to me what this sentence means thanks...

    The run-time memory model of a C or C++ program consists of statically allocated data, automatically allocated data, and dynamically allocated data.
    Data objects (e.g. variables) declared at namespace scope (which includes global scope) are statically allocated. Data objects local to a function that are declared static are also statically allocated. Static allocation means the storage for the data is available when the program is loaded, even before it begins to run. The data remains allocated until after the program exits.
    Data objects local to a function that are not declared static are automatically allocated when the function starts to run. Example:
    int foo() { int i; ... } Variable i does not exist until function foo begins to run, at which time space for it appears automatically. Each new invocation of foo gets its own location for i independent of other invocations of foo. Automatic allocation is usually referred to as stack allocation, since that is the usual implementation method: an area of storage that works like a stack, referenced by a dedicated machine register. Allocating the automatic data consists of adding (or subtracting) a value to the stack register. Popping the stack involves only subtracting (or adding) a value to the stack register. When the function exits, the stack is popped, releasing storage for all its automatic data.
    Dynamically allocated storage is acquired by an explicit use of a new-expression, or a call to an allocation function like malloc(). Example:
    int* ip = new int[100]; // allocate space for 100 integers
    double* id = (double*)malloc(100*sizeof(double)); // allocate space for 100 doublesDynamic storage is not released until you release it explicitly via a delete-expression or a call to free(). Managing the "heap", the area from where dynamic storage is acquired, and to which it is released, can be quite time-consuming.
    Your example of a Stack class (not to be confused with the program stack that is part of the C or C++ implementation) uses a fixed-size (that is, fixed at the point of template instance creation) automatically-allocated array to act as a stack data type. It has the advantage of taking zero time to allocate and release the space for the array. It has the disadvantages of any fixed-size array: it can waste space, or result in a program failure when you try to put N+1 objects into it, and it cannot be re-sized once created.

  • ICMP Timeout Alarm due to TCP Protocol Memory Allocation Failure ?

    Hello Experts ,
      >> Device uptime suggests there was no reboot
    ABCSwitch uptime is 28 weeks, 13 hours, 50 minutes
    System returned to ROM by power-on
    System restarted at 13:09:45 UTC Mon Aug 5 2013
    System image file is "flash:c2950-i6k2l2q4-mz.121-22.EA12.bin"
    >> But observed logs mentioning Memory Allocation Failure for TCP Protocol Process ( Process ID 43) due to Memory Fragmentation
    003943: Feb 18 02:14:27.393 UTC: %SYS-2-MALLOCFAIL: Memory allocation of 36000 bytes failed from 0x801E876C, alignment 0
    Pool: Processor Free: 120384 Cause: Memory fragmentation
    Alternate Pool: I/O Free: 682800 Cause: Memory fragmentation
    -Process= "TCP Protocols", ipl= 0, pid= 43
    -Traceback= 801C422C 801C9ED0 801C5264 801E8774 801E4CDC 801D9A8C 8022E324 8022E4BC
    003944: Feb 18 02:14:27.397 UTC: %SYS-2-CFORKMEM: Process creation of TCP Command failed (no memory).
    -Process= "TCP Protocols", ipl= 0, pid= 43
    -Traceback= 801E4D54 801D9A8C 8022E324 8022E4BC
    According to Cisco documentation for Troubleshooting Memory issues on Cisco IOS 12.1 (http://www.cisco.com/c/en/us/support/docs/ios-nx-os-software/ios-software-releases-121-mainline/6507-mallocfail.html#tshoot4 ), which suggests the TCP Protocols Process could not be started due to Memory being fragmented
    Memory Fragmentation Problem or Bug
    This situation means that a process has consumed a large amount of processor memory and then released most or all of it, leaving fragments of memory still allocated either by this process, or by other processes that allocated memory during the problem. If the same event occurs several times, the memory may fragment into very small blocks, to the point where all processes requiring a larger block of memory cannot get the amount of memory that they need. This may affect router operation to the extent that you cannot connect to the router and get a prompt if the memory is badly fragmented.
    This problem is characterized by a low value in the "Largest" column (under 20,000 bytes) of the show memory command, but a sufficient value in the "Freed" column (1MB or more), or some other wide disparity between the two columns. This may happen when the router gets very low on memory, since there is no defragmentation routine in the IOS.
    If you suspect memory fragmentation, shut down some interfaces. This may free the fragmented blocks. If this works, the memory is behaving normally, and all you have to do is add more memory. If shutting down interfaces doesn't help, it may be a bug. The best course of action is to contact your Cisco support representative with the information you have collected.
    >>Further TCP -3- FORKFAIL logs were seen
    003945: Feb 18 02:14:27.401 UTC: %TCP-3-FORKFAIL: Failed to start a process to negotiate options.
    -Traceback= 8022E33C 8022E4BC
    003946: Feb 18 02:14:27.585 UTC: %TCP-3-FORKFAIL: Failed to start a process to negotiate options.
    -Traceback= 8022E33C 8022E4BC
    003947: Feb 18 02:14:27.761 UTC: %TCP-3-FORKFAIL: Failed to start a process to negotiate options.
    -Traceback= 8022E33C 8022E4BC
    003948: Feb 18 02:14:27.929 UTC: %TCP-3-FORKFAIL: Failed to start a process to negotiate options.
    -Traceback= 8022E33C 8022E4BC
    003949: Feb 18 02:14:29.149 UTC: %TCP-3-FORKFAIL: Failed to start a process to negotiate options.
    -Traceback= 8022E33C 8022E4BC
    According to Error Explanation from Cisco Documentation (http://www.cisco.com/c/en/us/td/docs/ios/12_2sx/system/messages/122sxsms/sm2sx09.html#wp1022051)
    suggests the TCP handles from a client could not be created or initialized
    Error Message %TCP-3-FORKFAIL: Failed to start a process to negotiate options.
    Explanation The system failed to create a process to handle requests  from a client. This condition could be caused by insufficient  memory.
    Recommended Action Reduce other system activity to ease  memory demands.
    But I am still not sure about the exact root cause is as
    1.The GET/GETNEXT / GET BULK messages from SNMP Manager (Here, IBM Tivoli Netcool  ) uses default SNMP Port 161 which is
       UDP and not TCP
    2. If its ICMP Polling failure from IBM Tivoli Netcool , ICMP is Protocol Number 1 in Internet Layer of TCP/IP Protocol Suite  and TCP is Protocol                 Number 6 in the Transport Layer of TCP/IP Protocol Suite .
    So I am still not sure how TCP Protocol Process Failure could have caused ICMP Timeout . Please help !
    Could you please help me on what TCP Protocol Process handles in a Cisco Switch ?
    Regards,
    Anup

    Hello Experts ,
      >> Device uptime suggests there was no reboot
    ABCSwitch uptime is 28 weeks, 13 hours, 50 minutes
    System returned to ROM by power-on
    System restarted at 13:09:45 UTC Mon Aug 5 2013
    System image file is "flash:c2950-i6k2l2q4-mz.121-22.EA12.bin"
    >> But observed logs mentioning Memory Allocation Failure for TCP Protocol Process ( Process ID 43) due to Memory Fragmentation
    003943: Feb 18 02:14:27.393 UTC: %SYS-2-MALLOCFAIL: Memory allocation of 36000 bytes failed from 0x801E876C, alignment 0
    Pool: Processor Free: 120384 Cause: Memory fragmentation
    Alternate Pool: I/O Free: 682800 Cause: Memory fragmentation
    -Process= "TCP Protocols", ipl= 0, pid= 43
    -Traceback= 801C422C 801C9ED0 801C5264 801E8774 801E4CDC 801D9A8C 8022E324 8022E4BC
    003944: Feb 18 02:14:27.397 UTC: %SYS-2-CFORKMEM: Process creation of TCP Command failed (no memory).
    -Process= "TCP Protocols", ipl= 0, pid= 43
    -Traceback= 801E4D54 801D9A8C 8022E324 8022E4BC
    According to Cisco documentation for Troubleshooting Memory issues on Cisco IOS 12.1 (http://www.cisco.com/c/en/us/support/docs/ios-nx-os-software/ios-software-releases-121-mainline/6507-mallocfail.html#tshoot4 ), which suggests the TCP Protocols Process could not be started due to Memory being fragmented
    Memory Fragmentation Problem or Bug
    This situation means that a process has consumed a large amount of processor memory and then released most or all of it, leaving fragments of memory still allocated either by this process, or by other processes that allocated memory during the problem. If the same event occurs several times, the memory may fragment into very small blocks, to the point where all processes requiring a larger block of memory cannot get the amount of memory that they need. This may affect router operation to the extent that you cannot connect to the router and get a prompt if the memory is badly fragmented.
    This problem is characterized by a low value in the "Largest" column (under 20,000 bytes) of the show memory command, but a sufficient value in the "Freed" column (1MB or more), or some other wide disparity between the two columns. This may happen when the router gets very low on memory, since there is no defragmentation routine in the IOS.
    If you suspect memory fragmentation, shut down some interfaces. This may free the fragmented blocks. If this works, the memory is behaving normally, and all you have to do is add more memory. If shutting down interfaces doesn't help, it may be a bug. The best course of action is to contact your Cisco support representative with the information you have collected.
    >>Further TCP -3- FORKFAIL logs were seen
    003945: Feb 18 02:14:27.401 UTC: %TCP-3-FORKFAIL: Failed to start a process to negotiate options.
    -Traceback= 8022E33C 8022E4BC
    003946: Feb 18 02:14:27.585 UTC: %TCP-3-FORKFAIL: Failed to start a process to negotiate options.
    -Traceback= 8022E33C 8022E4BC
    003947: Feb 18 02:14:27.761 UTC: %TCP-3-FORKFAIL: Failed to start a process to negotiate options.
    -Traceback= 8022E33C 8022E4BC
    003948: Feb 18 02:14:27.929 UTC: %TCP-3-FORKFAIL: Failed to start a process to negotiate options.
    -Traceback= 8022E33C 8022E4BC
    003949: Feb 18 02:14:29.149 UTC: %TCP-3-FORKFAIL: Failed to start a process to negotiate options.
    -Traceback= 8022E33C 8022E4BC
    According to Error Explanation from Cisco Documentation (http://www.cisco.com/c/en/us/td/docs/ios/12_2sx/system/messages/122sxsms/sm2sx09.html#wp1022051)
    suggests the TCP handles from a client could not be created or initialized
    Error Message %TCP-3-FORKFAIL: Failed to start a process to negotiate options.
    Explanation The system failed to create a process to handle requests  from a client. This condition could be caused by insufficient  memory.
    Recommended Action Reduce other system activity to ease  memory demands.
    But I am still not sure about the exact root cause is as
    1.The GET/GETNEXT / GET BULK messages from SNMP Manager (Here, IBM Tivoli Netcool  ) uses default SNMP Port 161 which is
       UDP and not TCP
    2. If its ICMP Polling failure from IBM Tivoli Netcool , ICMP is Protocol Number 1 in Internet Layer of TCP/IP Protocol Suite  and TCP is Protocol                 Number 6 in the Transport Layer of TCP/IP Protocol Suite .
    So I am still not sure how TCP Protocol Process Failure could have caused ICMP Timeout . Please help !
    Could you please help me on what TCP Protocol Process handles in a Cisco Switch ?
    Regards,
    Anup

  • Queue of arrays without dynamic memory allocation

    Hey folks,
    I'm working on optimizing a timing critical VI. This VI is the
    producer in a producer consumer architecture. I'm trying to populate
    a queue from file in a manner that is as efficient as possible. My
    current plan of attack is:
    - read block of data from file and populate array (pre-allocated).
    - add array (always of the same size) to Queue with a max size defined
    (e.g. 50 elements)
    - This is in a while loop as is the standard producer consumer model.
    To improve the performance I would like to ensure that there is no
    dynamic memory allocation on the Queue's behalf. This is easily done,
    from what I understand, if the data type in the queue is of the same
    type (e.g. double, int). However, since the size of an array can vary
    does this mean that any queue of arrays will always dynamically
    allocate memory? Is there a way to ensure that the queue will always
    use the same memory as in a circular queue?
    Thanks,
    Steve

    Duplicate.
    Try to take over the world!

  • Degree in Dynamic memory allocation need help!

    I'm a student in the University of Bucharest in Computer-Science in the senior year. I'm looking for some specs for my degree in Dynamic memory allocation. In particular I was looking for specs about how the JVM heap and garbage collector work. Can you please direct me to someone how can help me find the necessary specs?
    Thank you.

    [http://java.sun.com/javase/technologies/hotspot/]
    ~

  • Problem in dynamic memory allocation

    Hi,
    My name is Ravi Kumar. I'm working on a project to improve organizational performance which include visual studio for simulation. I'm using dynamic memory allocation to allocate space for the array that are used in the program. Now I have run-time error
    which I can't understand where it is going wrong. Can someone please help me regrading this issue. 
    If anyone interested in helping please leave a comment with your email id so that I will share the whole project folder.
    Thanks,
    Ravi

    Hi Ravi,
    Don is right that this is the forum to discuss questions and feedback for Microsoft Office client.
    Please post in MSDN forum of Visual Studio, where you can get more experienced responses:
    https://social.msdn.microsoft.com/Forums/en-US/home?forum=visualstudiogeneral
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Crash the dynamic memory allocation

    hi
    i am new to java, my prof said to crash the java prog. write simple prog. which allocate dynamic memory in C++ and Java. push the limits to see how much allocation cause the programs to crash.
    how do i implement this in java.. can any one help out here.
    thanks in advances.

    Write a program that allocates larger and larger objects until it crashes. Make sure it prints the sizes of the objects as it runs.

  • Dynamic memory allocation on HP-UX for multiple instances on one host

    Hi everyone,
    I was wondering what the current possibilities are nowadays on running multiple SAP instances on one very large host with regard to resource sharing. Normally, for each instance, using PHYS_MEMSIZE etc you have to set the memory to a fixed size and then optimize it.
    Preferrably we would like the memory to be allocated based upon actual usage. Is that possible at all? on HP-UX? Using third party techniques?
    Thank you
    Marcel Rabe

    Hello Marcel,
    As Juan said you may not be able to change the parameters at runtime.
    The only parameters that can be dynamically switched are :
    ztta/roll_first
    ztta/roll_extension
    ztta/roll_area
    abap/heap_area_dia
    abap/heap_area_nondia
    abap/heap_area_total
    em/stat_log_size_MB
    em/stat_log_timeout
    These parameters would put a cap on memory allocations, however they wouldn't help increase the total addressable memory area.
    I would suggest that you consider Adaptive Computing for dynamic use of resources.
    Adaptive Computing
    Regards,
    Siddhesh

  • Dynamic memory allocation

    Hi, guys, does anyone know whether I can use dyanmic memory allocation on the Real time system with "call library function" node. DLL is programmed using C language. Thanks.
    Machman

    You certainly can. LabVIEW Real-Time functionality is really not much different than what you can do on Windows. The only difference being that you can now assign priorty and timing to your execution loops; essentially, you have determinism with RT whereas with Windows, you never have a guarantee.
    Thus, in regards to calling a dll, you can perform this the same way you would in LabVIEW for Windows. Here's a KnowledgeBase article on how to do this if you're not already familiar.
    Cheers,
    Emilie K. | Applications Engineer | National Instruments

  • Finding dynamic memory allocations in core file

    Hi,
    Is it possible to find out which data structures were allocated by analysing a core file?
    I want to find out which objects are causing the memory to increase, and I have the core file of the program.
    Thanks in advance,
    Paulo

    It's almost impossible. Anyway, it would be pure heuristics - looking at stack contents, finding familiar patterns in heap, etc, etc.

  • Why doesn't the debugger follow dynamic memory allocations well?

    Here's an example of a code block that doesn't seem to work right with the CVI compiler/debugger, but works fine with other C compilers/debuggers
    struct arg_int* arg_intn(const char* shortopts,
    const char* longopts,
    const char *datatype,
    int mincount,
    int maxcount,
    const char *glossary)
    size_t nbytes;
    struct arg_int *result;
    /* foolproof things by ensuring maxcount is not less than mincount */
    maxcount = (maxcount<mincount) ? mincount : maxcount;
    nbytes = sizeof(struct arg_int) /* storage for struct arg_int */
    + maxcount * sizeof(int); /* storage for ival[maxcount] array */
    result = (struct arg_int*)malloc(nbytes);
    if (result)
    /* init the arg_hdr struct */
    result->hdr.flag = ARG_HASVALUE;
    result->hdr.shortopts = shortopts;
    result->hdr.longopts = longopts;
    result->hdr.datatype = datatype ? datatype : "<int>";
    result->hdr.glossary = glossary;
    result->hdr.mincount = mincount;
    result->hdr.maxcount = maxcount;
    result->hdr.parent = result;
    result->hdr.resetfn = (arg_resetfn*)resetfn;
    result->hdr.scanfn = (arg_scanfn*)scanfn;
    result->hdr.checkfn = (arg_checkfn*)checkfn;
    result->hdr.errorfn = (arg_errorfn*)errorfn;
    /* store the ival[maxcount] array immediately after the arg_int struct */
    result->ival = (int*)(result+1);
    result->count = 0;
    /*printf("arg_intn() returns %p\n",result);*/
    return result;
    When I try to dereference this structure's 'ival[0]' the debugger constantly complains of a fatal runtime error and declares it out of the array bounds.
    This is from the argtable2 open source library available at http://argtable.sourceforge.net/ if you want to try and reproduce it.  I'm using CVI 2010 SP1.

    Unfortunately, you have run into one of the inherent limitations of CVI's run-time checking. Even though it is perfectly legal in C and somewhat common practice, our run-time checking doesn't like it when you conceptually split up a block of memory and treat it as two or more separate blocks. 
    While I cannot fix the problem in our run-time checking without breaking other use cases, I can explain what's causing the error and how you can work around it.
    When you malloc memory, we assume that the memory block is going to hold one or more instances of the type to which you're casting the memory block. In this case, CVI is treating the new memory block as an array of arg_info structures. But your new memory block is not big enough to hold more than one instance of struct arg_info, so we implicitly truncate the memory block to sizeof(struct arg_info). Because of the implicit truncation, s->values is now pointing past the end of the memory block and any access will result in an error.
    #include <ansi_c.h>
    struct arg_int {
    char some_large_block[64];
    int count;
    int *values;
    int main (int argc, char *argv[])
    int i, n = 4;
    struct arg_int *s = malloc(sizeof *s + n * sizeof *s->values);
    s->count = n;
    s->values = (int *)(s+1);
    for (i = 0; i < n; ++i)
    s->values[i] = i;
    return 0;
    You can avoid the implicit truncation in the original code by assigning to a (void*) first. This retains the original block size by keeping the actual type of the data in the memory block in limbo. Subsequent casts do not truncate the block. We truncate only when the cast occurs implicitly as part of a malloc. s->values points to the remainder of the block and you can access it freely, but you do not get any run-time checking on it.
    #include <ansi_c.h>
    struct arg_int {
    char some_large_block[64];
    int count;
    int *values;
    int main (int argc, char *argv[])
    int i, n = 4;
    struct arg_int *s;
    void *memory = malloc(sizeof *s + n * sizeof *s->values);
    s = memory;
    s->count = n;
    s->values = (int *)(s+1);
    for (i = 0; i < n; ++i)
    s->values[i] = i;
    return 0;
    If you want full run-time checking on s->values, you have to allocate the two components separately.
    #include <ansi_c.h>
    struct arg_int {
    char some_large_block[64];
    int count;
    int *values;
    int main (int argc, char *argv[])
    int i, n = 4;
    struct arg_int *s = malloc(sizeof *s);
    s->count = n;
    s->values = malloc(n * sizeof *s->values);
    for (i = 0; i < n; ++i)
    s->values[i] = i;
    return 0;
    Another option is to use an incomplete array. An incomplete array is an array of unspecified or zero size at the end of a structure definition. CVI is implicitly growing the array to fill up the rest of the allocated memory block. You do not get run-time checking for the array.
    #include <ansi_c.h>
    struct arg_int {
    char some_large_block[64];
    int count;
    int values[0];
    int main (int argc, char *argv[])
    int i, n = 4;
    struct arg_int *s = malloc(sizeof *s + n * sizeof *s->values);
    s->count = n;
    for (i = 0; i < n; ++i)
    s->values[i] = i;
    return 0;
    You can also disable run-time checking for your memory block by going through a series of casts: http://zone.ni.com/reference/en-XX/help/370051K-01/cvi/disablinguserprotectionforindividualpointer/
    Best regards.

  • Office 2001/Dynamic Memory?

    Do the programs in Office 2001 have Dynamic Memory while using OS 9.2?

    Hi, HappyWarlock -
    Welcome to Apple's Discussions.
    Do the programs in Office 2001 have Dynamic Memory while using OS 9.2?
    Probably not. I don't use Office, but the vast majority of programs in OS 9 do not have the ability to use dynamic memory allocation; a couple of exceptions are the OS itself (Finder), and SimpleText.
    You can change the allocation for the programs in Office manually; the number to change is the Preferred allocation amount.
    Article #18278 - Assigning More Memory to an Application

  • Memory Allocation problem when using JNI

    For a Project we need to interface Labwindows-CVI/ Teststand with an application written in Java. we are using JNI. The code uses JNI_CreateJavaVM to start a JVM to run the Java interface code. The code did run for some time , but now ( without any obvious change nor on the CVI side neither on the Java side) JNI_CreateJavaVM fails with -4 error code, that means that the start of the JVM failed due to memory allocation failure. First investigation showed, that even if Windows Task Manager shows about 600M free physical memory, you can allocate in CVI only about 250M as a single block at the time we are calling  JNI_CreateJavaVM. That might be a little bit to less as we need to pass -Xmx192m to the JVM to run our code. Unfortunately just increasing the physical memory of that machine from 1.5G to 2G doesn't change anything. The free memory showed by Task Manager increases, but the allocatable memory block size does not. Are the any trick to optimize CVI/Teststand for that use case ?  Or maybe known problems with JNI ?
    Solved!
    Go to Solution.

    hi,
    have you tried other functions to allocate memory?
    the -Xmx command only sets the maximum heap size. You can try to use -Xms. This command sets the initial Java heap size. 

  • Reliability of protected void finalize() for freeing native dynamic memory

    In different places, I've been reading different things about the specification of garbage collection in Java. From what I've found so far, it is pretty clear that if the garbage collector of the VM used decides to reclaim object X, then X.finalize() is called. However, opinions vary on whether the garbage collector will ever decide to reclaim X.
    I'm using the JNI and, unfortunately, have to keep a few bits in memory on the native side. Even worse, I keep those bits in dynamic memory (allocated with C's malloc). These chunks of memory always correspond to a single object on the Java side, so I thought it would be a good idea to have my objects in the native interface include this bit of code:
    native void free();
    protected void finalize() throws Throwable {
      Exception x = null;
      try {
        free();
        /* whatever other destruction seems usefull */
      } catch(Exception e) {
        CentralHandler.handle(this, e);
        x = e;
      } finally {
        try {
          super.finalize();
        } catch(Exception e) {
          CentralHandler.handle(this, e);
          if(x != null)
            throw CentralHandler.combine(x,e);
    }I have been told the problem with this is that I can't be sure the garbage collector will ever clear out this object, even when the program comes to an end (inside the VM; when the VM itself is killed, the user's on his own). Does it matter if finalize is never called and will all my malloc-ed memory just become free with the disappearance of the VM?

    What you have been told about GC is correct: You should not depend on finalize for anything.
    Assuming yours is a real-world program (and won't be graded), then if you are simply worried about memory being freed up when your program exits: Don't worry about it.

  • 9400 Graphics Memory Allocation

    For the GeForce 9400M chip is it possible to increase the graphics memory allocation if I were to upgrade the system memory?
    In other words: Does the GeForce 9400M chip and Mac OS Leopard+ support dynamic memory allocation for the graphics memory?
    If I increase the system RAM from 2GB to 4GB will the 9400 graphics memory allocation increase from 256MB to 512MB?
    (The Intel graphics chipset supported it)

    No. The 9400 uses 256 MBs of RAM, no more.

Maybe you are looking for

  • How to find the Obsolete function module in ECC 6.0

    Hi Guys, How we can find the all obsolete function in ECC 6.0, is any T-code to finding the obsolete function modules, or any other way to find. Could you please help me. Thanks, Gourisankar.

  • Upgrading from OS 8.6 to 10.3

    Do I need to install 9.2.x before installing 10.3 or is that included in the full 10.3 install? I'm trying to line up the software needed before upgrading my hard drive and memory.

  • Transferring EVERYTHING from one computer to another w/ same source

    I want to transfer all my iTunes files (playlists, music, play counts, everything) from one computer to another, on account of the logic board of my old one is messed up and I want to get everything on my Mac Book Pro. HOWEVER. When I was using my ol

  • My subscription payment didn't work

    Hi I need help with my subscription payments, it's been working for over a year and now suddenly it has a problem with my payment. My back account is not the problem money wise. So my question is do I start up a new subscription or wait and it will r

  • Importing errors - photos moved but not cataloged

    Hello all, I'm having an issue with LR3 (Mac OSX 10.6.4) when importing photos from HDD into the catalog.  Some of the photos imported (seemingly random) will error out with a code (8) "some files could not be moved".. or something to that effect.  I