Use JNI application has memory manager, feasible?

Hi,
This is an attempt to circumvent javas poor memory management capabilities. Since java is unable to allocate memory dynamically (*) I'm thinking of writing a native library capable of allocating memory and then allowing java applications to stow away data in this area. The application would be able to access the memory directly through some java.nio.ByteArray-type implementation.
The java application would be responsible for allocating and deallocating, reading and writing data.
Is this feasible? Has anyone done this already? I guess a JNI is solution would be pretty straightforward?
(...this will be my first experience with JNI)
(*) Xmx option can be used assuming you know beforehand the memory requirements.

Hi,
This is feasible since JNative already does this.
See Pointer and MemoryBlockFactory classes to do this.
--Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                           

Similar Messages

  • Pro*c multithreaded application has memory leak

    Hi there,
    I posted this message a week ago in OCI section, nobody answer me.
    I am really curious if my application has a bug or the pro*c has a bug.
    Anyone can compile the sample code and test it easily.
    I made multithreaded application which queries dynamic SQL, it works.
    But the memory leaks when i query the SQL statement.
    The more memory leaks, the more i query the SQL statement, even same SQL
    statement.
    I check it with top, shell command.
    My machine is SUN E450, Solaris 8. Oracle 9.2.0.1
    Compiler : gcc (GCC) 3.2.2
    I changed source code which is from
    $(ORACLE_HOME)/precomp/demo/proc/sample10.pc
    the sample10 doesn't need to be multithreaded. But i think it has to work
    correctly if i changed it to multithreaded application.
    the make file and source code will be placed below.
    I have to figure out the problem.
    Please help
    Thanks in advance,
    the make file is below
    HOME = /user/jkku
    ORA = $(ORACLE_HOME)
    CC = gcc
    PROC = proc
    LC_INCL = -I$(HOME)/work/dbmss/libs/include
    lc_incl = include=$(HOME)/work/dbmss/libs/include
    SYS_INCL =
    sys_incl =
    ORA_INCL = -I. \
    -I$(ORA)/precomp/public \
    -I$(ORA)/rdbms/public \
    -I$(ORA)/rdbms/demo \
    -I$(ORA)/rdbms/pbsql/public \
    -I$(ORA)/network/public \
    -DSLMXMX_ENABLE -DSLTS_ENABLE -D_SVID_GETTOD
    INCLUDES = $(LC_INCL) $(SYS_INCL) $(ORA_INCL)
    includes = $(lc_incl) $(sys_incl)
    LC_LIBS =
    SYS_LIBS = -lpthread -lsocket -lnsl -lrt
    ORA_LIBS = -L$(ORA)/lib/ -lclntsh
    LIBS = $(LC_LIBS) $(SYS_LIBS) $(ORA_LIBS)
    # Define C Compiler flags
    CFLAGS += -D_Solaris64_ -m64
    CFLAGS += -g -D_REENTRANT
    # Define pro*c Compiler flags
    PROCFLAGS += THREADS=YES
    PROCFLAGS += CPOOL=YES
    # Our object files
    PRECOMPS = sample10.c
    OBJS = sample10.o
    .SUFFIXES: .o .c .pc
    .c.o:
    $(CC) -c $(CFLAGS) $(INCLUDES) $*.c
    .pc.c:
    $(PROC) $(PROCFLAGS) $(includes) $*.pc $*.c
    all: sample10
    sample10: $(PRECOMPS) $(OBJS)
    $(CC) $(CFLAGS) -o sample10 $(OBJS) $(LIBS)
    clean:
    rm -rf *.o sample10 sample10.c
    the source code is below which i changed the oracle sample10.pc to
    multithreaded application.
    Sample Program 10: Dynamic SQL Method 4
    This program connects you to ORACLE using your username and
    password, then prompts you for a SQL statement. You can enter
    any legal SQL statement. Use regular SQL syntax, not embedded SQL.
    Your statement will be processed. If it is a query, the rows
    fetched are displayed.
    You can enter multi-line statements. The limit is 1023 characters.
    This sample program only processes up to MAX_ITEMS bind variables and
    MAX_ITEMS select-list items. MAX_ITEMS is #defined to be 40.
    #include <stdio.h>
    #include <string.h>
    #include <setjmp.h>
    #include <sqlda.h>
    #include <stdlib.h>
    #include <sqlcpr.h>
    /* Maximum number of select-list items or bind variables. */
    #define MAX_ITEMS 40
    /* Maximum lengths of the names of the
    select-list items or indicator variables. */
    #define MAX_VNAME_LEN 30
    #define MAX_INAME_LEN 30
    #ifndef NULL
    #define NULL 0
    #endif
    /* Prototypes */
    #if defined(__STDC__)
    void sql_error(void);
    int oracle_connect(void);
    int alloc_descriptors(int, int, int);
    int get_dyn_statement(void);
    void set_bind_variables(void);
    void process_select_list(void);
    void help(void);
    #else
    void sql_error(/*_ void _*/);
    int oracle_connect(/*_ void _*/);
    int alloc_descriptors(/*_ int, int, int _*/);
    int get_dyn_statement(/* void _*/);
    void set_bind_variables(/*_ void -*/);
    void process_select_list(/*_ void _*/);
    void help(/*_ void _*/);
    #endif
    char *dml_commands[] = {"SELECT", "select", "INSERT", "insert",
    "UPDATE", "update", "DELETE", "delete"};
    EXEC SQL INCLUDE sqlda;
    EXEC SQL INCLUDE sqlca;
    EXEC SQL BEGIN DECLARE SECTION;
    char dyn_statement[1024];
    EXEC SQL VAR dyn_statement IS STRING(1024);
    EXEC SQL END DECLARE SECTION;
    EXEC ORACLE OPTION (ORACA=YES);
    EXEC ORACLE OPTION (RELEASE_CURSOR=YES);
    SQLDA *bind_dp;
    SQLDA *select_dp;
    /* Define a buffer to hold longjmp state info. */
    jmp_buf jmp_continue;
    char *db_uid="dbmuser/dbmuser@dbmdb";
    sql_context ctx;
    int err_sql;
    enum{
    SQL_SUCC=0,
    SQL_ERR,
    SQL_NOTFOUND,
    SQL_UNIQUE,
    SQL_DISCONNECT,
    SQL_NOTNULL
    int main()
    int i;
    EXEC SQL ENABLE THREADS;
    EXEC SQL WHENEVER SQLERROR DO sql_error();
    EXEC SQL WHENEVER NOT FOUND DO sql_not_found();
    /* Connect to the database. */
    if (connect_database() < 0)
    exit(1);
    EXEC SQL CONTEXT USE :ctx;
    /* Process SQL statements. */
    for (;;)
    /* Allocate memory for the select and bind descriptors. */
    if (alloc_descriptors(MAX_ITEMS, MAX_VNAME_LEN, NAME_LEN) != 0)
    exit(1);
    (void) setjmp(jmp_continue);
    /* Get the statement. Break on "exit". */
    if (get_dyn_statement() != 0)
    break;
    EXEC SQL PREPARE S FROM :dyn_statement;
    EXEC SQL DECLARE C CURSOR FOR S;
    /* Set the bind variables for any placeholders in the
    SQL statement. */
    set_bind_variables();
    /* Open the cursor and execute the statement.
    * If the statement is not a query (SELECT), the
    * statement processing is completed after the
    * OPEN.
    EXEC SQL OPEN C USING DESCRIPTOR bind_dp;
    /* Call the function that processes the select-list.
    * If the statement is not a query, this function
    * just returns, doing nothing.
    process_select_list();
    /* Tell user how many rows processed. */
    for (i = 0; i < 8; i++)
    if (strncmp(dyn_statement, dml_commands, 6) == 0)
    printf("\n\n%d row%c processed.\n", sqlca.sqlerrd[2], sqlca.sqlerrd[2] == 1 ? '\0' : 's');
    break;
    /* Close the cursor. */
    EXEC SQL CLOSE C;
    /* When done, free the memory allocated for pointers in the bind and
    select descriptors. */
    for (i = 0; i < MAX_ITEMS; i++)
    if (bind_dp->V != (char *) 0)
    free(bind_dp->V);
    free(bind_dp->I); /* MAX_ITEMS were allocated. */
    if (select_dp->V != (char *) 0)
    free(select_dp->V);
    free(select_dp->I); /* MAX_ITEMS were allocated. */
    /* Free space used by the descriptors themselves. */
    SQLSQLDAFree(ctx, bind_dp);
    SQLSQLDAFree(ctx, select_dp);
    } /* end of for(;;) statement-processing loop */
    disconnect_database();
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    EXEC SQL COMMIT WORK RELEASE;
    puts("\nHave a good day!\n");
    return;
    * Allocate the BIND and SELECT descriptors using sqlald().
    * Also allocate the pointers to indicator variables
    * in each descriptor. The pointers to the actual bind
    * variables and the select-list items are realloc'ed in
    * the set_bind_variables() or process_select_list()
    * routines. This routine allocates 1 byte for select_dp->V
    * and bind_dp->V, so the realloc will work correctly.
    alloc_descriptors(size, max_vname_len, max_iname_len)
    int size;
    int max_vname_len;
    int max_iname_len;
    int i;
    * The first sqlald parameter determines the maximum number of
    * array elements in each variable in the descriptor. In
    * other words, it determines the maximum number of bind
    * variables or select-list items in the SQL statement.
    * The second parameter determines the maximum length of
    * strings used to hold the names of select-list items
    * or placeholders. The maximum length of column
    * names in ORACLE is 30, but you can allocate more or less
    * as needed.
    * The third parameter determines the maximum length of
    * strings used to hold the names of any indicator
    * variables. To follow ORACLE standards, the maximum
    * length of these should be 30. But, you can allocate
    * more or less as needed.
    if ((bind_dp =
    SQLSQLDAAlloc(ctx, size, max_vname_len, max_iname_len)) ==
    (SQLDA *) 0)
    fprintf(stderr,
    "Cannot allocate memory for bind descriptor.");
    return -1; /* Have to exit in this case. */
    if ((select_dp =
    SQLSQLDAAlloc(ctx, size, max_vname_len, max_iname_len)) == (SQLDA *)
    0)
    fprintf(stderr,
    "Cannot allocate memory for select descriptor.");
    return -1;
    select_dp->N = MAX_ITEMS;
    /* Allocate the pointers to the indicator variables, and the
    actual data. */
    for (i = 0; i < MAX_ITEMS; i++) {
    bind_dp->I = (short *) malloc(sizeof (short));
    select_dp->I = (short *) malloc(sizeof(short));
    bind_dp->V = (char *) malloc(1);
    select_dp->V = (char *) malloc(1);
    return 0;
    int get_dyn_statement()
    char *cp, linebuf[256];
    int iter, plsql;
    for (plsql = 0, iter = 1; ;)
    if (iter == 1)
    printf("\nSQL> ");
    dyn_statement[0] = '\0';
    fgets(linebuf, sizeof linebuf, stdin);
    cp = strrchr(linebuf, '\n');
    if (cp && cp != linebuf)
    *cp = ' ';
    else if (cp == linebuf)
    continue;
    if ((strncmp(linebuf, "EXIT", 4) == 0) ||
    (strncmp(linebuf, "exit", 4) == 0))
    return -1;
    else if (linebuf[0] == '?' ||
    (strncmp(linebuf, "HELP", 4) == 0) ||
    (strncmp(linebuf, "help", 4) == 0))
    help();
    iter = 1;
    continue;
    if (strstr(linebuf, "BEGIN") ||
    (strstr(linebuf, "begin")))
    plsql = 1;
    strcat(dyn_statement, linebuf);
    if ((plsql && (cp = strrchr(dyn_statement, '/'))) ||
    (!plsql && (cp = strrchr(dyn_statement, ';'))))
    *cp = '\0';
    break;
    else
    iter++;
    printf("%3d ", iter);
    return 0;
    void set_bind_variables()
    int i, n;
    char bind_var[64];
    /* Describe any bind variables (input host variables) */
    EXEC SQL WHENEVER SQLERROR DO sql_error();
    bind_dp->N = MAX_ITEMS; /* Initialize count of array elements. */
    EXEC SQL DESCRIBE BIND VARIABLES FOR S INTO bind_dp;
    /* If F is negative, there were more bind variables
    than originally allocated by sqlald(). */
    if (bind_dp->F < 0)
    printf ("\nToo many bind variables (%d), maximum is %d\n.",
    -bind_dp->F, MAX_ITEMS);
    return;
    /* Set the maximum number of array elements in the
    descriptor to the number found. */
    bind_dp->N = bind_dp->F;
    /* Get the value of each bind variable as a
    * character string.
    * C contains the length of the bind variable
    * name used in the SQL statement.
    * S contains the actual name of the bind variable
    * used in the SQL statement.
    * L will contain the length of the data value
    * entered.
    * V will contain the address of the data value
    * entered.
    * T is always set to 1 because in this sample program
    * data values for all bind variables are entered
    * as character strings.
    * ORACLE converts to the table value from CHAR.
    * I will point to the indicator value, which is
    * set to -1 when the bind variable value is "null".
    for (i = 0; i < bind_dp->F; i++)
    printf ("\nEnter value for bind variable %.*s: ",
    (int)bind_dp->C, bind_dp->S);
    fgets(bind_var, sizeof bind_var, stdin);
    /* Get length and remove the new line character. */
    n = strlen(bind_var) - 1;
    /* Set it in the descriptor. */
    bind_dp->L = n;
    /* (re-)allocate the buffer for the value.
    sqlald() reserves a pointer location for
    V but does not allocate the full space for
    the pointer. */
    bind_dp->V = (char *) realloc(bind_dp->V, (bind_dp->L + 1));
    /* And copy it in. */
    strncpy(bind_dp->V, bind_var, n);
    /* Set the indicator variable's value. */
    if ((strncmp(bind_dp->V, "NULL", 4) == 0) ||
    (strncmp(bind_dp->V, "null", 4) == 0))
    *bind_dp->I = -1;
    else
    *bind_dp->I = 0;
    /* Set the bind datatype to 1 for CHAR. */
    bind_dp->T = 1;
    return;
    void process_select_list()
    int i, null_ok, precision, scale;
    if ((strncmp(dyn_statement, "SELECT", 6) != 0) &&
    (strncmp(dyn_statement, "select", 6) != 0))
    select_dp->F = 0;
    return;
    /* If the SQL statement is a SELECT, describe the
    select-list items. The DESCRIBE function returns
    their names, datatypes, lengths (including precision
    and scale), and NULL/NOT NULL statuses. */
    select_dp->N = MAX_ITEMS;
    EXEC SQL DESCRIBE SELECT LIST FOR S INTO select_dp;
    /* If F is negative, there were more select-list
    items than originally allocated by sqlald(). */
    if (select_dp->F < 0)
    printf ("\nToo many select-list items (%d), maximum is %d\n",
    -(select_dp->F), MAX_ITEMS);
    return;
    /* Set the maximum number of array elements in the
    descriptor to the number found. */
    select_dp->N = select_dp->F;
    /* Allocate storage for each select-list item.
    sqlprc() is used to extract precision and scale
    from the length (select_dp->L).
    sqlnul() is used to reset the high-order bit of
    the datatype and to check whether the column
    is NOT NULL.
    CHAR datatypes have length, but zero precision and
    scale. The length is defined at CREATE time.
    NUMBER datatypes have precision and scale only if
    defined at CREATE time. If the column
    definition was just NUMBER, the precision
    and scale are zero, and you must allocate
    the required maximum length.
    DATE datatypes return a length of 7 if the default
    format is used. This should be increased to
    9 to store the actual date character string.
    If you use the TO_CHAR function, the maximum
    length could be 75, but will probably be less
    (you can see the effects of this in SQL*Plus).
    ROWID datatype always returns a fixed length of 18 if
    coerced to CHAR.
    LONG and
    LONG RAW datatypes return a length of 0 (zero),
    so you need to set a maximum. In this example,
    it is 240 characters.
    printf ("\n");
    for (i = 0; i < select_dp->F; i++)
    char title[MAX_VNAME_LEN];
    /* Turn off high-order bit of datatype (in this example,
    it does not matter if the column is NOT NULL). */
    sqlnul ((unsigned short *)&(select_dp->T), (unsigned short
    *)&(select_dp->T), &null_ok);
    switch (select_dp->T)
    case 1 : /* CHAR datatype: no change in length
    needed, except possibly for TO_CHAR
    conversions (not handled here). */
    break;
    case 2 : /* NUMBER datatype: use sqlprc() to
    extract precision and scale. */
    sqlprc ((unsigned int *)&(select_dp->L), &precision,
    &scale);
    /* Allow for maximum size of NUMBER. */
    if (precision == 0) precision = 40;
    /* Also allow for decimal point and
    possible sign. */
    /* convert NUMBER datatype to FLOAT if scale > 0,
    INT otherwise. */
    if (scale > 0)
    select_dp->L = sizeof(float);
    else
    select_dp->L = sizeof(int);
    break;
    case 8 : /* LONG datatype */
    select_dp->L = 240;
    break;
    case 11 : /* ROWID datatype */
    case 104 : /* Universal ROWID datatype */
    select_dp->L = 18;
    break;
    case 12 : /* DATE datatype */
    select_dp->L = 9;
    break;
    case 23 : /* RAW datatype */
    break;
    case 24 : /* LONG RAW datatype */
    select_dp->L = 240;
    break;
    /* Allocate space for the select-list data values.
    sqlald() reserves a pointer location for
    V but does not allocate the full space for
    the pointer. */
    if (select_dp->T != 2)
    select_dp->V = (char *) realloc(select_dp->V,
    select_dp->L + 1);
    else
    select_dp->V = (char *) realloc(select_dp->V,
    select_dp->L);
    /* Print column headings, right-justifying number
    column headings. */
    /* Copy to temporary buffer in case name is null-terminated */
    memset(title, ' ', MAX_VNAME_LEN);
    strncpy(title, select_dp->S, select_dp->C);
    if (select_dp->T == 2)
    if (scale > 0)
    printf ("%.*s ", select_dp->L+3, title);
    else
    printf ("%.*s ", select_dp->L, title);
    else
    printf("%-.*s ", select_dp->L, title);
    /* Coerce ALL datatypes except for LONG RAW and NUMBER to
    character. */
    if (select_dp->T != 24 && select_dp->T != 2)
    select_dp->T = 1;
    /* Coerce the datatypes of NUMBERs to float or int depending on
    the scale. */
    if (select_dp->T == 2)
    if (scale > 0)
    select_dp->T = 4; /* float */
    else
    select_dp->T = 3; /* int */
    printf ("\n\n");
    /* FETCH each row selected and print the column values. */
    EXEC SQL WHENEVER NOT FOUND GOTO end_select_loop;
    for (;;)
    EXEC SQL FETCH C USING DESCRIPTOR select_dp;
    /* Since each variable returned has been coerced to a
    character string, int, or float very little processing
    is required here. This routine just prints out the
    values on the terminal. */
    for (i = 0; i < select_dp->F; i++)
    if (*select_dp->I < 0)
    if (select_dp->T == 4)
    printf ("%-*c ",(int)select_dp->L+3, ' ');
    else
    printf ("%-*c ",(int)select_dp->L, ' ');
    else
    if (select_dp->T == 3) /* int datatype */
    printf ("%*d ", (int)select_dp->L,
    *(int *)select_dp->V);
    else if (select_dp->T == 4) /* float datatype */
    printf ("%*.2f ", (int)select_dp->L,
    *(float *)select_dp->V);
    else /* character string */
    printf ("%-*.*s ", (int)select_dp->L,
    (int)select_dp->L, select_dp->V);
    printf ("\n");
    end_select_loop:
    return;
    void help()
    puts("\n\nEnter a SQL statement or a PL/SQL block at the SQL> prompt.");
    puts("Statements can be continued over several lines, except");
    puts("within string literals.");
    puts("Terminate a SQL statement with a semicolon.");
    puts("Terminate a PL/SQL block (which can contain embedded
    semicolons)");
    puts("with a slash (/).");
    puts("Typing \"exit\" (no semicolon needed) exits the program.");
    puts("You typed \"?\" or \"help\" to get this message.\n\n");
    int connect_database()
    err_sql = SQL_SUCC;
    EXEC SQL WHENEVER SQLERROR DO sql_error();
    EXEC SQL WHENEVER NOT FOUND DO sql_not_found();
    EXEC SQL CONTEXT ALLOCATE :ctx;
    EXEC SQL CONTEXT USE :ctx;
    EXEC SQL CONNECT :db_uid;
    if(err_sql != SQL_SUCC){
    printf("err => connect database(ctx:%ld, uid:%s) failed!\n", ctx, db_uid);
    return -1;
    return 1;
    int disconnect_database()
    err_sql = SQL_SUCC;
    EXEC SQL WHENEVER SQLERROR DO sql_error();
    EXEC SQL WHENEVER NOT FOUND DO sql_not_found();
    EXEC SQL CONTEXT USE :ctx;
    EXEC SQL COMMIT WORK RELEASE;
    EXEC SQL CONTEXT FREE:ctx;
    return 1;
    void sql_error()
    printf("err => %.*s", sqlca.sqlerrm.sqlerrml, sqlca.sqlerrm.sqlerrmc);
    printf("in \"%.*s...\'\n", oraca.orastxt.orastxtl, oraca.orastxt.orastxtc);
    printf("on line %d of %.*s.\n\n", oraca.oraslnr, oraca.orasfnm.orasfnml,
    oraca.orasfnm.orasfnmc);
    switch(sqlca.sqlcode) {
    case -1: /* unique constraint violated */
    err_sql = SQL_UNIQUE;
    break;
    case -1012: /* not logged on */
    case -1089:
    case -3133:
    case -1041:
    case -3114:
    case -3113:
    /* �6�Ŭ�� shutdown�ǰų� �α��� ���°� �ƴҶ� ��b�� �õ� */
    /* immediate shutdown in progress - no operations are permitted */
    /* end-of-file on communication channel */
    /* internal error. hostdef extension doesn't exist */
    err_sql = SQL_DISCONNECT;
    break;
    case -1400:
    err_sql = SQL_NOTNULL;
    break;
    default:
    err_sql = SQL_ERR;
    break;
    EXEC SQL CONTEXT USE :ctx;
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    EXEC SQL ROLLBACK WORK;
    void sql_not_found()
    err_sql = SQL_NOTFOUND;

    Hi Jane,
    What version of Berkeley DB XML are you using?
    What is your operating system and your hardware platform?
    For how long have been the application running?
    What is your current container size?
    What's set for EnvironmentConfig.setThreaded?
    Do you know if containers have previously not been closed correctly?
    Can you please post the entire error output?
    What's the JDK version, 1.4 or 1.5?
    Thanks,
    Bogdan

  • Segmentation fault when using jni application

    Hi I have a segmentation fault whe i use jni with a c++ program, i don't know how to read hs_err_pid....log, can someone help me to analyse this file
    # An unexpected error has been detected by HotSpot Virtual Machine:
    # SIGSEGV (0xb) at pc=0x9704e824, pid=15092, tid=2983283632
    # Java VM: Java HotSpot(TM) Client VM (1.5.0_15-b04 mixed mode, sharing)
    # Problematic frame:
    # C 0x9704e824
    --------------- T H R E A D ---------------
    Current thread (0x08379000): JavaThread "Xxxxxxxx main loop #1 (machine)" [_thread_in_native, id=15101]
    siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0x9704e824
    Registers:
    EAX=0xb1f9c030, EBX=0xb1edafa0, ECX=0x48411fc8, EDX=0x08377218
    ESP=0xb1d13bfc, EBP=0xb1d13c18, ESI=0xb1f1020a, EDI=0xb1edc5a8
    EIP=0x9704e824, CR2=0x9704e824, EFLAGS=0x00010286
    Top of Stack: (sp=0xb1d13bfc)
    0xb1d13bfc: b1e78eb5 b1f9c030 48411fc8 b1e78e2b
    0xb1d13c0c: b1f9b494 b1d13c50 b0786e50 b1d13c78
    0xb1d13c1c: b1f6a332 b0786e50 48411fc8 b1d13c48
    0xb1d13c2c: b7bca34c 083790c0 b1d13c40 08410e58
    0xb1d13c3c: 00a0b574 b1f9c030 0838b2e0 b074ed18
    0xb1d13c4c: b1fca214 b1f9c360 0838b2e0 b072e2d8
    0xb1d13c5c: b1fb761c 08373ce8 b1d13c94 b1f6a16f
    0xb1d13c6c: b1f9b494 08373c08 00000001 b1d13cc8
    Instructions: (pc=0x9704e824)
    0x9704e814:
    [error occurred during error reporting, step 100, id 0xb]
    Stack: [0xb1c94000,0xb1d15000), sp=0xb1d13bfc, free space=510k
    Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
    C 0x9704e824
    C [libxxxxxxxxxx.so.1.6+0x7d332] _ZN10MyApplication12Route4tickEj+0x1ce
    C [libxxxxxxxxxx.so.1.6+0x34248] _ZN10MyApplication4Core8workEj+0x34
    C [libyyyyyy.so+0x15457] ZN5CCore8mainLoopEP7JNIEnv+0x17f
    C [libyyyyyy.so+0x1f299] Java_com_xx_xxxxxxxx_xxxxxxxximpl_jni_JCore_run+0x35
    j com.xx.xxxxxxxx.xxxxxxxximpl.jni.JCore.run()V+0
    v ~StubRoutines::call_stub
    V [libjvm.so+0x17b2bc]
    V [libjvm.so+0x28fed8]
    V [libjvm.so+0x17ab15]
    V [libjvm.so+0x17abae]
    V [libjvm.so+0x1f2b15]
    V [libjvm.so+0x2f9933]
    V [libjvm.so+0x290ae8]
    C [libpthread.so.0+0x5371]
    Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
    j com.xx.xxxxxxxx.xxxxxxxximpl.jni.JCore.run()V+0
    v ~StubRoutines::call_stub
    --------------- P R O C E S S ---------------
    Java Threads: ( => current thread )
    =>0x08379000 JavaThread "Xxxxxxxx main loop #1 (machine)" [_thread_in_native, id=15101]
    0x083634d8 JavaThread "Thread-0" [_thread_in_native, id=15100]
    0x080a5c60 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=15098]
    0x080a47a8 JavaThread "CompilerThread0" daemon [_thread_blocked, id=15097]
    0x080a3850 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=15096]
    0x0809dbe8 JavaThread "Finalizer" daemon [_thread_blocked, id=15095]
    0x0809bdb8 JavaThread "Reference Handler" daemon [_thread_blocked, id=15094]
    0x0805caa0 JavaThread "main" [_thread_in_native, id=15092]
    Other Threads:
    0x0809a940 VMThread [id=15093]
    0x080a71d0 WatcherThread [id=15099]
    VM state:not at safepoint (normal execution)
    VM Mutex/Monitor currently owned by a thread: None
    Heap
    def new generation total 576K, used 515K [0x88bc0000, 0x88c60000, 0x890a0000)
    eden space 512K, 95% used [0x88bc0000, 0x88c3a560, 0x88c40000)
    from space 64K, 40% used [0x88c40000, 0x88c46888, 0x88c50000)
    to space 64K, 0% used [0x88c50000, 0x88c50000, 0x88c60000)
    tenured generation total 1408K, used 918K [0x890a0000, 0x89200000, 0x8cbc0000)
    the space 1408K, 65% used [0x890a0000, 0x89185850, 0x89185a00, 0x89200000)
    compacting perm gen total 8192K, used 500K [0x8cbc0000, 0x8d3c0000, 0x90bc0000)
    the space 8192K, 6% used [0x8cbc0000, 0x8cc3d110, 0x8cc3d200, 0x8d3c0000)
    ro space 8192K, 68% used [0x90bc0000, 0x91142e10, 0x91143000, 0x913c0000)
    rw space 12288K, 48% used [0x913c0000, 0x91991640, 0x91991800, 0x91fc0000)
    Dynamic libraries:
    00113000-00121000 r-xp 00000000 03:01 6292457 /lib/tls/libpthread-2.3.4.so
    00121000-00123000 rwxp 0000d000 03:01 6292457 /lib/tls/libpthread-2.3.4.so
    00123000-00125000 rwxp 00123000 00:00 0
    0022c000-0023b000 r-xp 00000000 03:01 6292459 /lib/libresolv-2.3.4.so
    0023b000-0023d000 rwxp 0000f000 03:01 6292459 /lib/libresolv-2.3.4.so
    0023d000-0023f000 rwxp 0023d000 00:00 0
    002be000-002c5000 r-xp 00000000 03:01 6292458 /lib/libgcc_s-3.4.6-20060404.so.1
    002c5000-002c6000 rwxp 00007000 03:01 6292458 /lib/libgcc_s-3.4.6-20060404.so.1
    002e8000-003a8000 r-xp 00000000 03:01 10722848 /usr/lib/libstdc++.so.6.0.3
    003a8000-003ad000 rwxp 000bf000 03:01 10722848 /usr/lib/libstdc++.so.6.0.3
    003ad000-003b3000 rwxp 003ad000 00:00 0
    0087d000-0088f000 r-xp 00000000 03:01 6292465 /lib/libnsl-2.3.4.so
    0088f000-00891000 rwxp 00011000 03:01 6292465 /lib/libnsl-2.3.4.so
    00891000-00893000 rwxp 00891000 00:00 0
    00b99000-00bae000 r-xp 00000000 03:01 6292453 /lib/ld-2.3.4.so
    00bae000-00baf000 r-xp 00015000 03:01 6292453 /lib/ld-2.3.4.so
    00baf000-00bb0000 rwxp 00016000 03:01 6292453 /lib/ld-2.3.4.so
    00bb7000-00cdc000 r-xp 00000000 03:01 6292454 /lib/tls/libc-2.3.4.so
    00cdc000-00cdd000 r-xp 00124000 03:01 6292454 /lib/tls/libc-2.3.4.so
    00cdd000-00ce0000 rwxp 00125000 03:01 6292454 /lib/tls/libc-2.3.4.so
    00ce0000-00ce2000 rwxp 00ce0000 00:00 0
    00ce4000-00d05000 r-xp 00000000 03:01 6292455 /lib/tls/libm-2.3.4.so
    00d05000-00d07000 rwxp 00020000 03:01 6292455 /lib/tls/libm-2.3.4.so
    00d09000-00d0b000 r-xp 00000000 03:01 6292456 /lib/libdl-2.3.4.so
    00d0b000-00d0d000 rwxp 00001000 03:01 6292456 /lib/libdl-2.3.4.so
    08048000-08057000 r-xp 00000000 03:01 11715142 /usr/java/jdk1.5.0_15/bin/java
    08057000-08059000 rwxp 0000e000 03:01 11715142 /usr/java/jdk1.5.0_15/bin/java
    08059000-086b9000 rwxp 08059000 00:00 0
    88bc0000-88c60000 rwxp 88bc0000 00:00 0
    88c60000-890a0000 rwxp 88c60000 00:00 0
    890a0000-89200000 rwxp 890a0000 00:00 0
    89200000-8cbc0000 rwxp 89200000 00:00 0
    8cbc0000-8d3c0000 rwxp 8cbc0000 00:00 0
    8d3c0000-90bc0000 rwxp 8d3c0000 00:00 0
    90bc0000-91143000 r-xs 00001000 03:01 11698348 /usr/java/jdk1.5.0_15/jre/lib/i386/client/classes.jsa
    91143000-913c0000 rwxp 91143000 00:00 0
    913c0000-91992000 rwxp 00584000 03:01 11698348 /usr/java/jdk1.5.0_15/jre/lib/i386/client/classes.jsa
    91992000-91fc0000 rwxp 91992000 00:00 0
    91fc0000-92090000 rwxp 00b56000 03:01 11698348 /usr/java/jdk1.5.0_15/jre/lib/i386/client/classes.jsa
    92090000-923c0000 rwxp 92090000 00:00 0
    923c0000-923c4000 r-xs 00c26000 03:01 11698348 /usr/java/jdk1.5.0_15/jre/lib/i386/client/classes.jsa
    923c4000-927c0000 rwxp 923c4000 00:00 0
    b0500000-b0521000 rwxp b0500000 00:00 0
    b0521000-b0600000 --xp b0521000 00:00 0
    b0600000-b0636000 rwxp b0600000 00:00 0
    b0636000-b0700000 --xp b0636000 00:00 0
    b0700000-b0800000 rwxp b0700000 00:00 0
    b0873000-b0874000 --xp b0873000 00:00 0
    b0874000-b1c74000 rwxp b0874000 00:00 0
    b1c74000-b1c78000 r-xp 00000000 03:01 6291503 /lib/libnss_dns-2.3.4.so
    b1c78000-b1c7a000 rwxp 00003000 03:01 6291503 /lib/libnss_dns-2.3.4.so
    b1c94000-b1c97000 --xp b1c94000 00:00 0
    b1c97000-b1d15000 rwxp b1c97000 00:00 0
    b1d15000-b1d1b000 r-xs 00000000 03:01 10748120 /usr/lib/gconv/gconv-modules.cache
    b1fcb000-b1fdd000 r-xp 00000000 03:01 11603256 /usr/java/jdk1.5.0_15/jre/lib/i386/libnet.so
    b1fdd000-b1fde000 rwxp 00011000 03:01 11603256 /usr/java/jdk1.5.0_15/jre/lib/i386/libnet.so
    b1fde000-b1fe1000 --xp b1fde000 00:00 0
    b1fe1000-b205f000 rwxp b1fe1000 00:00 0
    b2089000-b214f000 r-xs 00000000 03:01 11698359 /usr/java/jdk1.5.0_15/jre/lib/ext/localedata.jar
    b214f000-b2152000 r-xs 00000000 03:01 11698358 /usr/java/jdk1.5.0_15/jre/lib/ext/dnsns.jar
    b2152000-b217d000 r-xs 00000000 03:01 11698357 /usr/java/jdk1.5.0_15/jre/lib/ext/sunpkcs11.jar
    b217d000-b21a4000 r-xs 00000000 03:01 11698356 /usr/java/jdk1.5.0_15/jre/lib/ext/sunjce_provider.jar
    b21a4000-b21a5000 --xp b21a4000 00:00 0
    b21a5000-b2225000 rwxp b21a5000 00:00 0
    b2225000-b2228000 --xp b2225000 00:00 0
    b2228000-b22a6000 rwxp b2228000 00:00 0
    b22a6000-b22a9000 --xp b22a6000 00:00 0
    b22a9000-b2327000 rwxp b22a9000 00:00 0
    b2327000-b232a000 --xp b2327000 00:00 0
    b232a000-b23a8000 rwxp b232a000 00:00 0
    b23a8000-b25a8000 r-xp 00000000 03:01 10717357 /usr/lib/locale/locale-archive
    b25a8000-b25ab000 --xp b25a8000 00:00 0
    b25ab000-b2629000 rwxp b25ab000 00:00 0
    b2629000-b262c000 --xp b2629000 00:00 0
    b262c000-b26aa000 rwxp b262c000 00:00 0
    b26aa000-b26ab000 --xp b26aa000 00:00 0
    b26ab000-b273c000 rwxp b26ab000 00:00 0
    b273c000-b2758000 rwxp b273c000 00:00 0
    b2758000-b2759000 rwxp b2758000 00:00 0
    b2759000-b2776000 rwxp b2759000 00:00 0
    b2776000-b2777000 rwxp b2776000 00:00 0
    b2777000-b2778000 rwxp b2777000 00:00 0
    b2778000-b277a000 rwxp b2778000 00:00 0
    b277a000-b2796000 rwxp b277a000 00:00 0
    b2796000-b279a000 rwxp b2796000 00:00 0
    b279a000-b27b6000 rwxp b279a000 00:00 0
    b27b6000-b27c5000 rwxp b27b6000 00:00 0
    b27c5000-b2841000 rwxp b27c5000 00:00 0
    b2841000-b2941000 rwxp b2841000 00:00 0
    b2941000-b4841000 rwxp b2941000 00:00 0
    b4841000-b50b0000 r-xs 00000000 03:01 11603318 /usr/java/jdk1.5.0_15/jre/lib/charsets.jar
    b50b0000-b50c5000 r-xs 00000000 03:01 11603283 /usr/java/jdk1.5.0_15/jre/lib/jce.jar
    b50c5000-b514a000 r-xs 00000000 03:01 11603316 /usr/java/jdk1.5.0_15/jre/lib/jsse.jar
    b514a000-b51b3000 rwxp b514a000 00:00 0
    b51b3000-b77db000 r-xs 00000000 03:01 11603320 /usr/java/jdk1.5.0_15/jre/lib/rt.jar
    b77db000-b77ea000 r-xp 00000000 03:01 11603253 /usr/java/jdk1.5.0_15/jre/lib/i386/libzip.so
    b77ea000-b77ec000 rwxp 0000e000 03:01 11603253 /usr/java/jdk1.5.0_15/jre/lib/i386/libzip.so
    b77ec000-b780d000 r-xp 00000000 03:01 11603251 /usr/java/jdk1.5.0_15/jre/lib/i386/libjava.so
    b780d000-b780f000 rwxp 00020000 03:01 11603251 /usr/java/jdk1.5.0_15/jre/lib/i386/libjava.so
    b780f000-b7818000 r-xp 00000000 03:01 6291506 /lib/libnss_files-2.3.4.so
    b7818000-b781a000 rwxp 00008000 03:01 6291506 /lib/libnss_files-2.3.4.so
    b7820000-b782b000 r-xp 00000000 03:01 11603250 /usr/java/jdk1.5.0_15/jre/lib/i386/libverify.so
    b782b000-b782c000 rwxp 0000b000 03:01 11603250 /usr/java/jdk1.5.0_15/jre/lib/i386/libverify.so
    b782c000-b7834000 rwxs 00000000 03:01 6619137 /tmp/hsperfdata_myname/15092
    b7834000-b783a000 r-xp 00000000 03:01 11603246 /usr/java/jdk1.5.0_15/jre/lib/i386/native_threads/libhpi.so
    b783a000-b783b000 rwxp 00006000 03:01 11603246 /usr/java/jdk1.5.0_15/jre/lib/i386/native_threads/libhpi.so
    b783b000-b783c000 rwxp b783b000 00:00 0
    b783c000-b783d000 r-xp b783c000 00:00 0
    b783d000-b7baf000 r-xp 00000000 03:01 11698345 /usr/java/jdk1.5.0_15/jre/lib/i386/client/libjvm.so
    b7baf000-b7bcd000 rwxp 00372000 03:01 11698345 /usr/java/jdk1.5.0_15/jre/lib/i386/client/libjvm.so
    b7bcd000-b7fe6000 rwxp b7bcd000 00:00 0
    bfe00000-bfe03000 --xp bfe00000 00:00 0
    bfe03000-c0000000 rwxp bfe03000 00:00 0
    ffffe000-fffff000 ---p 00000000 00:00 0
    VM Arguments:
    jvm_args: -Xcheck:jni -XX:+PrintCompilation
    java_command: myapplication
    Launcher Type: SUN_STANDARD
    Environment Variables:
    PATH=/home/myname/XXXXXXXX_PERF/bin:/usr/java/jdk1.5.0_15/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/bin:/home/myname/bin
    LD_LIBRARY_PATH=/usr/java/jdk1.5.0_15/jre/lib/i386/client:/usr/java/jdk1.5.0_15/jre/lib/i386:/usr/java/jdk1.5.0_15/jre/../lib/i386:/home/myname/XXXXXXXX/lib
    SHELL=/bin/bash
    DISPLAY=XXX.XXX.X.XXX:0.0
    Signal Handlers:
    SIGSEGV: [libjvm.so+0x32b740], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    SIGBUS: [libjvm.so+0x32b740], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    SIGFPE: [libjvm.so+0x28ef10], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    SIGPIPE: [libjvm.so+0x28ef10], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    SIGILL: [libjvm.so+0x28ef10], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
    SIGUSR2: [libjvm.so+0x291360], sa_mask[0]=0x00000000, sa_flags=0x14000004
    SIGHUP: [libjvm.so+0x290d90], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    SIGINT: [libjvm.so+0x290d90], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    SIGQUIT: [libjvm.so+0x290d90], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    SIGTERM: [libjvm.so+0x290d90], sa_mask[0]=0x7ffbfeff, sa_flags=0x14000004
    --------------- S Y S T E M ---------------
    OS:Red Hat Enterprise Linux WS release 4 (Nahant Update 4)
    uname:Linux 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:27:17 EDT 2006 i686
    libc:glibc 2.3.4 NPTL 2.3.4
    rlimit: STACK 20480k, CORE 0k, NPROC 16375, NOFILE 1024, AS infinity
    load average:3.46 1.36 0.50
    CPU:total 2 (cores per cpu 1, threads per core 2) family 15 model 4 stepping 1, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ht
    Memory: 4k page, physical 1034096k(389000k free), swap 0k(0k free)
    vm_info: Java HotSpot(TM) Client VM (1.5.0_15-b04) for linux-x86, built on Feb 9 2008 01:37:00 by java_re with gcc 3.2.1-7a (J2SE release)
    Regards
    Fr�d�ric

    Simple - something is wrong with your C/C++ code.
    You have a pointer/memory bug.

  • I cannot connect my ipad with the program of yamaha stagemix, is urgent that they solve this problem to me, buys ipad esfecificamente to use that application

    I cannot connect my ipad with the program of yamaha stagemix, is urgent that they solve this problem to me, buys ipad esfecificamente to use that application, has somebody been able it to solve?

    I cannot connect my ipad with the program of yamaha stagemix, is urgent that they solve this problem to me, buys ipad esfecificamente to use that application, has somebody been able it to solve?

  • Solaris Memory Management Algorithms

    Hi everyone,
    Does Solaris use a 'buddy' algorithm for dealing with external memory fragmentation like Linux.
    Secondly, does Solaris still use a 'slab-allocator' scheme for dealing with internal memory fragmentation as it did in in the 2.4 release.

    I think the answers for all these questions are covered in the very excelent book "Solaris Internals - Core Kernel Architecture", by Jim Mauro & Richard McDougall, Prentice Hall. ISBN 0130224960. If you want to learn the Solaris Operating System under the hood, this is a "must-have" book. See also this url: http://www.cs.tcd.ie/Sotirios.Terzis/3BA3/L6/sld029.htm as well as this one: http://tyrant112.tripod.com/overbeck/SolarisMem.htm. There are useful information about Solaris Memory Management available therre.

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

  • Memory management while implementing JNI interfaces.

    The assumption here is that java code calls a C function from a
    shared library in Linux.
    How should memory management be done in the native code called
    from Java using a JNI interface?
    What role does the Garbage Collector play in handling memory that
    was allocated in the native C code?
    If I allocate memory using malloc() in the C program, should I
    explicitly free it? Will the GC take care of it?
    Does anyone have an idea of how memory management be done while
    implementing a JNI interface?
    Thanks,
    Nisahnt

    NishantMungse wrote:
    The assumption here is that java code calls a C function from a
    shared library in Linux.
    How should memory management be done in the native code called
    from Java using a JNI interface?
    C: Alloc something giving a pointer
    C: Return pointer to Java as a long.
    C: As needed methods take a long parameter and cast to correct pointer.
    C: Provide a destroy() method that takes a long, casts to correct pointer and deallocates correctly.
    Java: class keeps long
    Java: As needed JNI methods are passed long
    Java: Provide a destroy() method which passes long to C destroy() method if long is not zero. After call set long to zero.
    Java: Optional: Add a finalizer. It calls destroy()
    Last step is optional if your programming environment is strict AND the usage of the class has a restricted scope.
    The above assumes that you are going to use the memory in a 'normal' way. For instance there allocations are relatively small, and exist for short amounts of time. If that isn't true then you might need to tune the usage in much the same way that you might if you had a Java class that consumed a large amount of memory.
    What role does the Garbage Collector play in handling memory that
    was allocated in the native C code?
    It doesn't.
    At some point it can interfere with the heap though.
    If I allocate memory using malloc() in the C program, should I
    explicitly free it? Will the GC take care of it?
    You must explicitly free it.
    Does anyone have an idea of how memory management be done while
    implementing a JNI interface?See above.

  • Unable to install Adobe CS5 64 bit package created using Adobe Application Manager on Windows 7 64

    I am unable to install Adobe CS5 64 bit package created using Adobe Application Manager on Windows 7 64 bit.Basically installation rollback on Win 7 64 bit image.
    MSI Log File :-
    Property(S): ProductToBeRegistered = 1
    MSI (s) (5C:D4) [17:59:21:784]: Note: 1: 1708
    MSI (s) (5C:D4) [17:59:21:784]: Product: Adobe_CreativieSuite_5_MNT -- Installation operation failed.
    MSI (s) (5C:D4) [17:59:21:784]: Windows Installer installed the product. Product Name: Adobe_CreativieSuite_5_MNT. Product Version: 1.2.0000. Product Language: 1033. Manufacturer: Adobe Systems Incorporated. Installation success or error status: 1603.
    Please let me how to install 64 bit package on Win7 64 bit.
    Thanks in Advance.

    Ok so I downloaded the most current installer CS5.1, My previous installer was version 5.0. It did install fine fully updated to my license version. I just wanted to update in case anyone in the future has a similiar experience. Too bad this advice was not offered by the "experts" here.

  • I want to download whatever updates I need for Photoshop CS5. I try using Adobe Application manager and it isnt working.

    I want to download whatever updates I need for Photoshop CS5. I am using Adobe Application Manager and there are updates but they arnt going through. It has been awhile since I tried. Dont remember when the last time was. But my Mac Book Pro is in good shape and I am finally getting around to this. didnt expect it not to work. Help?

    Hi Richei Creative,
    These would be my suggestions:
    Create a new user account with administrative rights, log out of your current account and into that one, launch Adobe Application Manager and attempt the Photoshop update again.
    Instructions if you need them  - http://support.apple.com/kb/PH11468
    If this fails, uninstall Photoshop (Applications > Utilities > Adobe Installers) and reinstall Photoshop then from Adobe Application Manager the attempt the Photoshop update again, also from the newly created user account.
    Hope these help,
    -Dave

  • Memory management in plugins using Cocoa

    Hello,
    In Obj-C memory management guide stated: "If you spawn a secondary thread, you must create your own autorelease pool as soon as the thread begins executing; otherwise, you will leak objects."
    I assume that it also applies to Acrobat Plugins? What are the guidelines of using NSAutoreleasePools in plugins and is there any specific things in plugins' memory manamgement?

    If you have multiple subvis grabbing 200MB each you might try using the "Request Deallocation" function so that once a vi is done processing it releases the memory.
    LabVIEW Help: "When a top-level VI calls a subVI, LabVIEW allocates a data space
    of memory in which that subVI runs. When the subVI finishes running, LabVIEW
    usually does not deallocate the data space until the top-level VI finishes
    running or until the entire application stops, which can result in out-of-memory
    conditions and degradation of performance. Use this function to deallocate the
    data space immediately after the VI completes execution."
    Programming >> Application Control >> Memory Control >> Request Deallocation
    I think it first appeared in LabVIEW 7.1.
    Message Edited by Troy K on 07-14-2008 09:36 AM
    Troy
    CLDEach snowflake in an avalanche pleads not guilty. - Stanislaw J. Lec
    I haven't failed, I've found 10,000 ways that don't work - Thomas Edison
    Beware of the man who won't be bothered with details. - William Feather
    The greatest of faults is to be conscious of none. - Thomas Carlyle

  • 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

  • EMac has poor memory management

    I use an eMac and a G5. I would expect the G5 to be much faster than the eMac but here's a funny thing: I find that the G5 also manages memory much better than the eMac! For example, when I run OmniWeb for a long time on my eMac and really put it through its paces, loading up multiple pages and tabs, I find that OmniWeb starts running slower. Not surprising, but the rest of the computer starts running slower too! For example, creating a new folder may take several seconds.
    Even stranger: after I quit all of my programs, the sluggishness continues. My eMac does not recover until I completely restart. Maybe OmniWeb has a memory leak or something, but this doesn't happen on the G5! I can put OmniWeb through its paces on the G5 and launch twice as many programs, including Photoshop, with no noticeable slowdown.
    Now here's the weirdest thing of all: both computers have exactly the same amount of memory (768 MB) and both have plenty of free hard drive space (over 40 GB). All the memory on my eMac is Apple brand. I have even clean-reinstalled the OS on my eMac, to no avail.
    Is it normal that memory management would be so much better on a G5 than an eMac?

    The improvements in each OS generation in memory management involve swapping tasks in and out of memory more efficiently, not using less memory --- invariablly more memory is actually used (to do more tasks). It would've been clearer had I noted that each OS generation does more with the memory and places more stringent demands on the RAM timing. Memory chips tha were good enough under 10.1 failed when 10.2 came out; ditto with 10.3/10.2 and 10.4/10.3
    See what Console and/or Activity Monitor tell you is using CPU cycles.

  • I just tried to install the 11.4 update (or whichever one is the most recent update as of 1/26/2014) and when it failed i tried to install manually and now whenever i try to use it, i get the following error: the application has failed to start because MS

    i just tried to install the 11.4 update (or whichever one is the most recent update as of 1/26/2014) and when it failed i tried to install manually and now whenever i try to use it, i get the following error: "The application has failed to start because MSVCR80.dll was not found. Re-installing the application may fix this problem." Right after i click ok i then get this error: "Itunes was not installed correctly. Please reinstall Itunes. Error 7 (Windows error 126)." I tried to uninstall Itunes and then reinstall the 11.03 version but that didnt work either. I want to know if i copy all of the music in my itunes folder to an external without consolidating can i still transfer all my itunes music from my current windows xp pc to a brand new one and have my current itunes library in my new pc? Basically i just want to know 3 things: What exactly does consolidating the itunes library do? Can i copy, paste, and transfer my itunes library to an external and from there to a new pc? Will i be able to transfer my itunes library without consolidating the files?

    I have found a temporary solution, allowing the previous version of iTunes (v. 11.1.3 (x64) in my case) to be re-installed.  It will allow you to re-establish use of iTunes until the Apple software engineers fix the most recent disasterous upgrade (v. 11.1.4).  Please see and follow the procedure in the following article:http://smallbusiness.chron.com/reverting-previous-version-itunes-32590.html   The previous version works beautifully.

  • How can i call a VB6 project from my java application using JNI

    hi
    can anyone tell me the procedure of calling a VB6 project from any java application using JNI
    if anyone does know then tell me the detail procedure of doing that. I know that i have to create a dll of that VB6 project then to call it from the java application.
    if anyone know that procedure of creating dll file of an existing VB6 project please reply
    please if anyone know then let me know

    Ahh, kind of a duplicate thread:
    http://forums.java.sun.com/thread.jspa?threadID=631642
    @OP. You could have clarified your original post and the relationship of your question to java. You did not need a new thread.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Call to a C++ DLL, using JNI - C++ method has char*

    I am trying to link into an existing C++ Dynamically Linked Library(DLL) using the Java Native Interface(JNI).
    All goes fine, and the library loads into the current program, however when I try to call the function, it crashes. The function has char pointers, and I haven;t been able to get Java to simulate them. Is there a way?????
    I have tried using and array of chars .....char[], and String, but no dice.
    Any suggestions O'learned Java ones??

    It will be necessary for you to write a JNI adapter in C/C++ to accomplish this. Java character strings and arrays are very different from those of C/C++ and you'll have to use JNI functions to adapt.
    Chuck

Maybe you are looking for

  • If I purchase a Mac can I convert my PC files saved on a backup to my Mac?

    If I buy a Mac, can I convert my PC files, folder, saved on a backup to my Mac

  • ITunes won't start after Windows 7 Repair install

    Hi there I recently had to repair my Windows 7 64 bit Home Premium edition installation. It warned me before reinstalling that there could be some problems with iTunes following the repair but I followed the instructions to counter this and repair Wi

  • A favor to adobe

    Hello, I am a student studying in Korea, majoring in applied IT & engineering. The reason why I an writing this e-mail is to ask a favor to your company. Actually, my friends and I are applying for a contest which is about 'what can we learn from oth

  • MAC pro is BETTER??

    Hey again. I was considering purchasing an alien-ware desktop computer, either the area-51 7500 or the aurora 7500 with the default setups. However, after seeing the Mac Pro, I was hesitant about making that purchase. Would the MAC Pro be better than

  • MPEG-4 from After Effects?

    I'm trying to export an MPEG-4 file for upload to YouTube from After Effects with the following settings: MPEG4 (DivX, Xvid) format 640×480 resolution 64k Mono or 128k Stereo MP3 audio 30 fps I don't see the MPEG-4 preset in the Format popup of the O