Memory leak in image rings on Linux

Hello all,
I have a very serious problem I didn't have in previous version of my soft and one of the only addition I've made recently is to use image rings. The soft uses 6Mb more every minute. If I remove the rings, it stops. It could be a wrong lead, so I'm trying to write a test case, but is there a list of identified memory leaks somewhere ?
THanks.
Solved!
Go to Solution.

OK guys, there's a very serious leak on Linux, confirmed by the code below. Every time you change the value of a picture ring, either by clicking on the arrow of the picture ring or right-click on it (callback to SetCtrlVal), it uses 1 extra Mb of mem for a 512x512 pixel image !!!
Here's a sample code:
// Right-click the ring to cause memory leak
#include <stdio.h>
#include <stdlib.h>
#include <cvirte.h>
#include <userint.h>
#define RND_COLOR (((rand()<<16) ^ (rand()<<8) ^ rand()) & 0xFFFFFF)
// (int)((double)(0xFFFFFF)*rand()/RAND_MAX)
static int Pnl=0,
Text, Ring, // Controls
NbVals=16, // Number of images in the ring
Width=512, Height=512; // Of the Canvas and image ring
// Returns memory used by process in 4Kb page:
// TotalSize Resident Share Text Lib Data Dirty
// See "man proc" section statm
static char* ReadOffMemoryStatus(void) {
static char statm[80];
statm[0]='\0';
#ifdef _NI_linux_
FILE *f = fopen("/proc/self/statm","r");
if (f)
fgets (statm, 79, f),
fclose(f);
#endif
return statm;
static void Prepare(const int Nb) {
Point polyPoints[10]={{0,0}};
char Str[10];
int i, Bitmap;
int Canvas=NewCtrl(Pnl, CTRL_CANVAS, "", 0, 0);
SetCtrlAttribute(Pnl, Canvas, ATTR_DRAW_POLICY, VAL_UPDATE_IMMEDIATELY);
SetCtrlAttribute(Pnl, Canvas, ATTR_WIDTH, Width);
SetCtrlAttribute(Pnl, Canvas, ATTR_HEIGHT, Height);
// SetCtrlAttribute(Pnl, Canvas, ATTR_ENABLE_ANTI_ALIASING, 1); // No compile on Linux
SetCtrlAttribute(Pnl, Canvas, ATTR_PICT_BGCOLOR, RND_COLOR /*VAL_TRANSPARENT*/);
SetCtrlAttribute(Pnl, Canvas, ATTR_PEN_FILL_COLOR, RND_COLOR);
SetCtrlAttribute(Pnl, Canvas, ATTR_PEN_COLOR, RND_COLOR);
SetCtrlAttribute(Pnl, Canvas, ATTR_PEN_WIDTH, 7);
for (i=0; i<10; i++)
polyPoints[i].x=(Width*rand()/RAND_MAX),
polyPoints[i].y=(Height*rand()/RAND_MAX);
sprintf(Str, "%d", Nb);
// CanvasStartBatchDraw(Pnl, Canvas);
// This sometimes doesn't work on Linux
CanvasDrawPoly (Pnl, Canvas, 10, polyPoints, 1, VAL_DRAW_FRAME_AND_INTERIOR);
CanvasDrawLine (Pnl, Canvas, MakePoint(Width-1,0), MakePoint(0, Height-1));
SetCtrlAttribute(Pnl, Canvas, ATTR_PEN_COLOR, VAL_BLACK);
SetCtrlAttribute(Pnl, Canvas, ATTR_PEN_FILL_COLOR, VAL_WHITE);
CanvasDrawText(Pnl, Canvas, Str, VAL_APP_META_FONT,
MakeRect (2, 2, VAL_KEEP_SAME_SIZE, VAL_KEEP_SAME_SIZE), VAL_UPPER_LEFT);
// CanvasEndBatchDraw(Pnl, Canvas);
GetCtrlBitmap(Pnl, Canvas, 0, &Bitmap);
DiscardCtrl (Pnl, Canvas);
InsertListItem(Pnl, Ring, Nb, NULL, Nb); // The value is the color, so remember which one you use
SetCtrlBitmap (Pnl, Ring, Nb, Bitmap);
DiscardBitmap (Bitmap);
int CVICALLBACK cb_Change(int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
static int i=0;
switch (event) {
case EVENT_RIGHT_CLICK:
case EVENT_RIGHT_DOUBLE_CLICK:
SetCtrlVal(Pnl, Ring, i=(i+1)%NbVals);
// No break;
case EVENT_COMMIT:
SetCtrlVal(Pnl, Text, ReadOffMemoryStatus());
break;
return 0;
int CVICALLBACK cb_Quit(int panel, int control, int event,
void *callbackData, int eventData1, int eventData2) {
switch (event) {
case EVENT_COMMIT: QuitUserInterface (0); break;
return 0;
int main (int argc, char *argv[]) {
int i, Quit;
if (InitCVIRTE (0, argv, 0) == 0) return -1;
Pnl = NewPanel (0, "Test image ring", 20, 20, Height+20, Width);
Text = NewCtrl (Pnl, CTRL_STRING_LS, "Memory use (in 4Kb pages)", 0, 0);
Ring = NewCtrl (Pnl, CTRL_PICTURE_RING, "", 20, 0);
Quit = NewCtrl (Pnl, CTRL_SQUARE_BUTTON_LS, "", 50, 50);
SetCtrlAttribute(Pnl, Ring, ATTR_HEIGHT, Height);
SetCtrlAttribute(Pnl, Ring, ATTR_WIDTH, Width);
SetCtrlAttribute (Pnl, Ring, ATTR_CTRL_MODE, VAL_HOT);
SetCtrlAttribute(Pnl, Ring, ATTR_CALLBACK_FUNCTION_POINTER, cb_Change);
for (i=0; i<NbVals; i++) Prepare(i);
SetCtrlAttribute(Pnl, Text, ATTR_WIDTH, 250);
SetCtrlAttribute(Pnl, Text, ATTR_LABEL_LEFT, 250);
SetCtrlAttribute(Pnl, Text, ATTR_LABEL_TOP, 0);
SetCtrlAttribute(Pnl, Quit, ATTR_CALLBACK_FUNCTION_POINTER, cb_Quit);
SetCtrlAttribute(Pnl, Quit, ATTR_VISIBLE, 0);
SetCtrlAttribute(Pnl, Quit, ATTR_SHORTCUT_KEY, VAL_ESC_VKEY);
SetPanelAttribute(Pnl, ATTR_CLOSE_CTRL, Quit);
DisplayPanel (Pnl);
RunUserInterface ();
return 0;
There are other issues as well:
 - CanvasDrawPoly sometimes doesn't work.
 - The anti-aliasing on a canvas doesn't compile.
Is there anything more recent than CVI 2010 for Linux ?!?

Similar Messages

  • Memory leak in OCCI/libclnts on Linux RHEL 5.5 ? Please advise...

    Hi all,
    Starting with some background:
    I have an application that has been running on 32-bit Linux server for years without problem, a few weeks ago it was ported to 64-bit RHEL 5.5 (compiled with -m32). Now with the application in the new environment some processes are growing in memorysize.
    I have tried to pinpoint the memory leak with Valgrind and have numerous leaks reported in "libclntsh.so", "libocci.so" and "libnnz11.so"
    Examples:
    ==30114== Use of uninitialised value of size 4
    ==30114== at 0xA61BAD7: ztcedecb (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0xA61B1E2: ztcedencbk (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0xA61AA0A: ztcebn (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0xA61A561: ztcen (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8DA9725: ztceenc (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8E68920: ztcrbm (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8E684D5: ztcrbh (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8E68393: ztcrbp (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8E682C6: ztcr2seed (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8E6827F: ztcrseed3 (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8DAA24A: ztcsh (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x99727D7: kpucpcreate (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    And:
    ==30114== Conditional jump or move depends on uninitialised value(s)
    ==30114== at 0x8E69BBC: ztvo5ke (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8D55E68: kpu8lgn (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8D53E56: kpuauthxa (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8D536DB: kpuauth (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x996EB99: kpucpinithstnode (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x996FFB1: kpucpcrecons (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x9972871: kpucpcreate (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x9821048: OCIConnectionPoolCreate (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x7BFB896: oracle::occi::ConnectionPoolImpl::initialise(oracle::occi::EnvironmentImpl*, void*, unsigned int, void*, unsigned int, void*, unsigned int, unsigned int, unsigned int, unsigned int) (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libocci.so.11.1)
    ==30114== by 0x7BFBB79: ZN6oracle4occi18ConnectionPoolImplC9EPNS015EnvironmentImplERKSsS5_S5_jjj (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libocci.so.11.1)
    ==30114== by 0x7BFBAC7: oracle::occi::ConnectionPoolImpl::ConnectionPoolImpl(oracle::occi::EnvironmentImpl*, std::string const&, std::string const&, std::string const&, unsigned int, unsigned int, unsigned int) (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libocci.so.11.1)
    ==30114== by 0x7BF2C13: oracle::occi::EnvironmentImpl::createConnectionPool(std::string const&, std::string const&, std::string const&, unsigned int, unsigned int, unsigned int) (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libocci.so.11.1)
    And:
    ==30114== Conditional jump or move depends on uninitialised value(s)
    ==30114== at 0xAC3B2A5: CMP_RecomputeLength (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libnnz11.so)
    ==30114== by 0xAC3B9EC: CMP_Divide (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libnnz11.so)
    ==30114== by 0xAC3B5BA: CMP_ModularReduce (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libnnz11.so)
    ==30114== by 0xAC3A2E6: Alg_ComputeModQ_GHash (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libnnz11.so)
    ==30114== by 0xAC3AA30: A_X931RandomGenerateBytes (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libnnz11.so)
    ==30114== by 0x8E681F0: ztcr2rnd (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8DAA260: ztcsh (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8CD0125: kpusattr (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x8CE96CD: OCIAttrSet (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libclntsh.so.11.1)
    ==30114== by 0x7BF6184: oracle::occi::ConnectionImpl::openConnection(OCIEnv*, OCIError*, void*, unsigned int, void*, unsigned int, void*, unsigned int, void*, unsigned int, unsigned int, void*, unsigned int, oracle::occi::Connection::Purity, oracle::occi::StatelessConnectionPool::PoolType) (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libocci.so.11.1)
    ==30114== by 0x7BF9C29: ZN6oracle4occi14ConnectionImplC9EPNS018ConnectionPoolImplERKSsS5_ (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libocci.so.11.1)
    ==30114== by 0x7BF9AD1: oracle::occi::ConnectionImpl::ConnectionImpl(oracle::occi::ConnectionPoolImpl*, std::string const&, std::string const&) (in /soe3/opt/oracle-1/product/32bit-client-11.2.0.2/lib/libocci.so.11.1)
    There has been quite a few changes due to the new server. New compiler (gcc) from version 2.96 to 4.1.2, new version of oracle client 10g to 11g (11.2.0.2), new version of OCCI (also 11.2.0.2). The applications sourcecode is pretty much unchanged though, and that is why I turn to all of you for help.
    Is there anyone who knows anything about this problem and how to even start to fix this leak (if it even is in OCCI)?
    I can supply sourcecode and/or logs if needed. It is quite a lot of complex code so it might take me a while to sort out the relevant code though...

    Thanks for your input! Tough this post is from some time ago this is still an issue for me I'm afraid, so I appreciate all the help I can get.
    I have stripped down the code to just the basic functions needed to replicate the problem. The pool creation and connections are the same as in our application (which is unchanged since before the porting). Though the following code makes no indications of a leak when run through Valgrind, it still grows when checked in "top". It could be that I stripped the code too much, but this is pretty much what our application does. It creates a database lock (not in this code), creates connection, (read table), terminates connection and release lock every 6 seconds to check if there is any new assignments added...
    #include <iostream>
    #include <string>
    #include <occi.h>
    using namespace oracle::occi;
    using namespace std;
    Environment *env;
    ConnectionPool *connPool;
    Connection *con;
    int x, loopnr;
    string usr = "test_user";
    string pwd = "test_pw";
    string url = "dbtest";
    void run(int x) { // Run loops
    for(int i=0; i<x; i++){ // Loop connect and disconnect x number of times
    try {
    fflush(stdout); // Update console row for count value
    con = connPool->createConnection (usr, pwd); // Connect
    usleep(100000);
    connPool->terminateConnection (con); // Disconnect
    cout << "\r"; // Update console row for count value
    cout << loopnr << endl; // Print number of loops done
    usleep(100000);
    loopnr++; // Count number of loops done
    catch(SQLException ex) { // Exception handling
    cout<<"SQLException"<<endl;
    cout<<"Error number: "<< ex.getErrorCode() << endl;
    cout<<ex.getMessage() << endl;
    int main(int argc,char* argv[]) {
    cout << "IN --- main()\n";
    if(argc == 2) { // Read number of loops as argument...
    x = atoi(argv[1]);
    else { // ...or run loop 200 times if no args
    x = 200;
    try{
    env = Environment::createEnvironment (Environment::DEFAULT); // Create environment
    loopnr = 1;
    connPool = env->createConnectionPool(usr, pwd, url, 1, 2, 1); // Create pool
    run(x); // Run loops
    catch(SQLException ex) { // Exception handling
    cout<<"SQLException"<<endl;
    cout<<"Error number: "<< ex.getErrorCode() << endl;
    cout<<ex.getMessage() << endl;
    env->terminateConnectionPool (connPool); // Cleanup Pool when done
    Environment::terminateEnvironment (env); // Cleanup Environment when done
    cout << "\nUT --- main()\n";
    return 0;
    Above code is built with the following makefile:
    ORACLE_HOME=/opt/oracle/product/32bit-client-11.2.0.2
    CXXFLAGS = -Wall -m32 -g -fPIC \
    -I$(ORACLE_HOME)/rdbms/public
    LDLIBS = -L$(ORACLE_HOME)/lib/ -locci \
    -L$(ORACLE_HOME)/rdbms/lib/ -lclntsh
    LDFLAGS = -m32
    default: all
    Sample: Sample.cc
    all: Sample
    clean:
    rm -f Sample *.o
    Hopefully someone can make sense out of this....
    Edited by: StLa on 2011-nov-23 04:57

  • Applet Memory Leak - Resizing Images

    Hello,
    I'm having an issue with a Java Applet I have written. The applet reads a directory listing, and displays resized thumbnails in a JTable. The problem is, if the user loads a directory with a lot of large images, the memory usage sky rockets, and is not freed after the user shuts down the applet.
    Below is the code which adds the resized image to a custom table model:
        public void leftClick(){
             main.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
            FileSystemView fsv = FileSystemView.getFileSystemView();
            ImageIcon thumbnailIcon = new ImageIcon();
            ImageIcon icon = new ImageIcon();
            File selectedFile = fileTree.getSelectedFile();
            Image scaledImage;
            if(selectedFile!=null){
                if (selectedFile.isDirectory()){
                    File subFiles[] = selectedFile.listFiles();
                    mvtm.clearList();
                    fileTable.removeAll();
                    TableColumn col = fileTable.getColumnModel().getColumn(0);
                    col.setMaxWidth(35);
                    col = fileTable.getColumnModel().getColumn(1);
                    col.setPreferredWidth(200);
                    col = fileTable.getColumnModel().getColumn(3);
                    col.setPreferredWidth(0);
                    col.setMaxWidth(0);          
                    for(int i = 0;i<subFiles.length;i++){
                        if(subFiles.getName().toLowerCase().contains(".jpg")||
    subFiles[i].getName().toLowerCase().contains(".gif")||
    subFiles[i].getName().toLowerCase().contains(".png")||
    subFiles[i].getName().toLowerCase().contains(".bmp")){
    icon = new ImageIcon(subFiles[i].getPath());
    scaledImage = Utils.getScaledImage(icon.getImage(), 30, 30);
    thumbnailIcon = new ImageIcon(scaledImage);
    }else{
    icon = (ImageIcon)fsv.getSystemIcon(subFiles[i]);     
    scaledImage = Utils.getScaledImage(icon.getImage(), 30, 30);
    thumbnailIcon = new ImageIcon(scaledImage);
    mvtm.addFileRecord(thumbnailIcon, subFiles[i].getName(),
    Long.toString(subFiles[i].length()), subFiles[i]);
    main.setCursor(null);
    The resize method is here:
        static Image getScaledImage(Image srcImg, int w, int h){
            BufferedImage resizedImg;
            resizedImg = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
            Graphics2D g2 = resizedImg.createGraphics();
            g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
            g2.drawImage(srcImg, 0, 0, w,h, Color.WHITE, null);
            g2.dispose();
            return resizedImg;
        }I have tried to nullify all objects created by overriding the applet destroy method:
        public void destroy(){
            fileTree.getFileTreeListener().clearMvtm();
            addButton = null;
            fileTable = null;
            jLabel1 = null;
            jPanel1 = null;
            jPanel2 = null;
            jProgressBar1 = null;
            jScrollPane1 = null;
            jScrollPane2 = null;
            jScrollPane3 = null;
            messageLabel = null;
            removeButton = null;
            uploadButton = null;
            uploadQueueTable = null;
            fileTree = null;
            fileModel = null;
            uploadQueueModel = null;
            task = null;
            Runtime r = Runtime.getRuntime();
            r.gc();
        }Any help is appreciated.
    Ryan
    Edited by: rthompson2000 on Sep 24, 2008 10:33 AM

    Hi SoulTech,
    thanks for the response. Interesting point I forgot to mention. On my machine, the JVM launches separately, (ie, I get the little Java icon in my task tray on the bottom right of my PC). When I close the applet pop-up, the java icon is still there, and the java.exe process is still running in Task Manager. After about a minute or two, the Java icon disappears, and Java.exe is no longer a running process (ie. the memory is gone, but this takes a minute or two! I want this to stop immediately).
    When I try this in a friends PC, they don't get the JVM icon in their taskbar, and all of the memory is allocated to the ieexplorer.exe process. After they close the applet pop-up window, browsing is very slow since their IEexplorer memory is very high because of the applet.
    can you hook up a profiler?
    I'm just getting familiar with the Netbeans profiler. I am able to see that all of the memory is being allocated in the leftClick() method I posted above. All of the memory is being hogged mainly by type int[] in sun.awt.image.ImageRepresentation.setPixels() and java.awt.image.DataBufferInt
    can you see the vm in the process table?
    See my above explanation. The java.exe process seems to die after a minute or two, but I don't think it frees memory when the VM is running inside the browser (as in the case on my friends PC)
    are you sure destroy is even getting called?
    How can I be sure? You said it didn't need to have anything in it anyways so does it matter?
    are you getting errors?
    No errors.

  • Applescript Image Events appears to have memory leak (or I don't know what I am doing)

    Using Image Events to create images and thumbnails for a website. The following code results in very large memory leaks in Image Event process. I have documented results of test runs in the comments.
    The leak (or poor coding on my part) results in a total system halt if I attempt to process more than about 400 images at a time. Basically, I run out ot physical memory. I am running a new model 13" MBP with 8GM RAM.  I have to manually stop Image Events to reclaim the memory (or reboot of course).
    Any help/suggestions would be appreciated.
    (* test memory leak in Image Events *)
              tests with 58 photos selected in iPhoto
              5.7 MB left in Image Events after run with only open and close
              22.0 MB left in Image Events after run with open, save and close
              45.9 MB left in Image Events after run with open, scale, save and close
              A run with 382 photos selected used OVER 3.8 GB (gigabytes) and the
              mac ran out of physical memory so I had to stop the test.
    tell application "Finder"
              set imageFolder to folder "test" of home as alias
    end tell
    tell application "iPhoto"
              set currPhotoList to the selection
              repeat with currPhoto in currPhotoList
                        log name of currPhoto as string
                        set theImagePath to image path of currPhoto
                        tell application "Image Events"
      launch
                                  set theImage to open theImagePath
      scale theImage to size 128
      save theImage in imageFolder as JPEG with icon
      close theImage
                        end tell
              end repeat
    end tell
    --- end of code example

    Does the following code do any difference? Most likely no I guess… but better try than nothing.
    tell application "Finder"
        set imageFolder to folder "test" of home as text -- instead of “as alias” (see theTargetPath below)
    end tell
    set theImagePaths to {}
    set theImagePathsRef to a reference to theImagePaths -- faster with big lists
    tell application "iPhoto"
        set currPhotoList to the selection
        repeat with currPhoto in currPhotoList
            log name of currPhoto as string
            get POSIX file (image path of currPhoto) as alias -- faster ?
            copy result to the end of theImagePathsRef
        end repeat
    end tell
    tell application "Image Events"
        launch
        repeat with theImagePath in theImagePaths
            set theImage to open theImagePath
            scale theImage to size 128
            set theTargetPath to (imageFolder & name of theImagePath)
            save theImage in theTargetPath as JPEG with icon
            close theImage
        end repeat
    end tell

  • OBIEE 11.1.1.5 Memory Leak issues

    Hardware: 64 bit Red Hat Linux Enterprise server 5.2(Tikanga)
    Software: OBIEE 11.1.1.5 64 bit
    Issue: The memory usage on the server slowly creeps up and occupies almost all of the available memory, then starts swapping.
    In our case we have a 48GB RAM 2CPU Linux box on which OBIEE 11.1.1.5 was installed and once we startup Weblogic Server, NodeManager, Managed Server, and OPMN, the memory usage starts at ~4GB and slowly creeps up to ~45GB. The processes do not release the memory back even after shutting down all the services (OPMN, Managed Server, Weblogic Server and Node Manager).
    The memory is released only after the Linux box is rebooted.
    We have the same software on different boxes which have 8GB RAM and the behavior is same there too. It occupies all of 8GB RAM and then swaps over another 4GB space. Is there a software leak with OBIEE 11.1.1.5 or is it a configuration issue?
    We found similar issues reported in forums at Memory Leak on OBIEE webserver 11G (linux version) But there was no resolution.

    All,
    We're having a similar issue, or at least we think we are on our 64-bit VM Windows environment, running OBIEE 11.1.1.3. Our PROD environment was OS level patched last Tuesday and rebooted, and now it's super slow and using way more RAM than before. Even if we reboot the server, our Managed server (bi_server1) is not working properly. Basically in DEV the Admin and Managed servers are using around 900 MB or RAM, in our PROD env that isn't working properly, the Admin server seems fine at about 900 MB of RAM, but our Managed server is up around 1.4 GB and now taking about 45 minutes to start instead of around 6. We also logged an SR about a week ago to no avail so far, and as you said, it's been going back and forth with the OBIEE and WebLogic teams. If anyone knows anything about this it would be great to hear it!
    Thanks,
    Josh
    Edited by: JFuter on Aug 24, 2011 1:39 PM

  • Memory leak in ldap_parse_ds_event

    Hi,
    I'm doing some development with the eDir LDAP event API and noticed some
    memory leakage. Valgrind points the finger at ldap_parse_ds_event:
    ==32146== 220 bytes in 5 blocks are definitely lost in loss record 4 of 5
    ==32146== at 0x401CCA0: calloc (vg_replace_malloc.c:279)
    ==32146== by 0x404D995: ber_memcalloc (memory.c:293)
    ==32146== by 0x404CEEB: ber_alloc_t (io.c:271)
    ==32146== by 0x404CF84: ber_dup (io.c:307)
    ==32146== by 0x40520DB: ldap_parse_intermediate (extended.c:374)
    ==32146== by 0x4174176: ldap_parse_ds_event
    (/home/n4u_cm/ccm_wa/idc_n4u/cldap~sdk_2007June/cldap/nldapx/extensions/client/src/events.c:2325)
    ==32146== by 0x804AD94: main (idmtrace.c:839)
    Is anybody from Novell labs about that can fix this? 44 bytes per message
    received may not sound like a lot, but the code is dealing with trace
    messages so it gets large rather quickly. The problem exists in the latest
    June 2007 libraries, as well as the LDAP libraries released in eDir 8.7.3.9
    and 8.8.1.
    Thanks,
    Steve

    Hi Steve,
    It would be very nice if you can supply me with sample code to reproduce
    memory leak. I've no Linux box now but i'll try to reproduce the same
    problem on NetWare platform. Also i need brief description of eDir event
    to be monitored.
    Best Regards,
    Andrey Karyagin
    ABG Card Technology
    Software Development Department
    [email protected] wrote:
    > Hi,
    > I'm doing some development with the eDir LDAP event API and noticed some
    > memory leakage. Valgrind points the finger at ldap_parse_ds_event:
    >
    > ==32146== 220 bytes in 5 blocks are definitely lost in loss record 4 of 5
    > ==32146== at 0x401CCA0: calloc (vg_replace_malloc.c:279)
    > ==32146== by 0x404D995: ber_memcalloc (memory.c:293)
    > ==32146== by 0x404CEEB: ber_alloc_t (io.c:271)
    > ==32146== by 0x404CF84: ber_dup (io.c:307)
    > ==32146== by 0x40520DB: ldap_parse_intermediate (extended.c:374)
    > ==32146== by 0x4174176: ldap_parse_ds_event
    > (/home/n4u_cm/ccm_wa/idc_n4u/cldap~sdk_2007June/cldap/nldapx/extensions/client/src/events.c:2325)
    > ==32146== by 0x804AD94: main (idmtrace.c:839)
    >
    > Is anybody from Novell labs about that can fix this? 44 bytes per message
    > received may not sound like a lot, but the code is dealing with trace
    > messages so it gets large rather quickly. The problem exists in the latest
    > June 2007 libraries, as well as the LDAP libraries released in eDir 8.7.3.9
    > and 8.8.1.
    >
    > Thanks,
    > Steve

  • Oracle 8.1.5 Linux Memory Leak?

    We have been running Oracle 8.1.5 Server and Client on Redhat 6.1
    kernel 2.2.12-20
    glibc-2.1.2-11
    Blackdown's JDK 1.2 RC3
    We are having bad memory leaks and we have verified that they are
    not in our source code using a memory profiler for Java-linux.
    We are using the JDBC calls and the OCI JDBC driver.
    We think that the memory leak is in libocijdbc8.so but we're not
    sure. It could also be in glibc but the 2.1.2-11 version should
    be pretty stable. It could also be in the Blackdown jvm.
    Anyone have any ideas?
    null

    Oracle8iR2's JDBC works fine with Oracle8.1.5.
    You can download the new JDBC driver.
    null

  • Memory Leak in Linux

    Hi friends,
    Is anyone worked on any of the tools to identify and optimise Java Memory Leak in Linux environment?

    Hi friends,
    Is anyone worked on any of the tools to identify and
    optimise Java Memory Leak in Linux environment?Hi,
    I've been using Optimizeit on linux, and I like it.
    /Kaj

  • Memory Leak in edited images?

    I am using Captivate 4.0.1 Build 1658 (this means that the patch from May 2009 is applied) on Windows Vista.
    The following has happened to myself and at least 2 other developers.
    We edit a slide background image in Photoshop...when the  movie plays, a flash of the previously unedited background shows.  I have tried re-editing the background and it does not fix the problem. I have tried eliminating transistions and it does not fix the problem.  I have noticed that this happens when background images are edited in Photoshop as well as within Captivate when bitmaps are pasted onto a slide background and then merged into the background.
    I don't know if the correct term for this is a memory leak, but the closest mention of this problem I could find was here: http://blogs.adobe.com/captivate/2009/05/captvate_4_patch_update.html
    I appreciate any help resolving this.
    Thank you,
    Beth

    The Reset Firefox feature can fix many issues by restoring Firefox to its factory default state while saving your essential information.
    Note: ''This will cause you to lose any Extensions, Open websites, and some Preferences.''
    To Reset Firefox do the following:
    #Go to Firefox > Help > Troubleshooting Information.
    #Click the "Reset Firefox" button.
    #Firefox will close and reset. After Firefox is done, it will show a window with the information that is imported. Click Finish.
    #Firefox will open with all factory defaults applied.
    Further information can be found in the [[Reset Firefox – easily fix most problems]] article.
    Did this fix your problems? Please report back to us!

  • Image Memory Leaks in AIR app

    We are implementing an AIR application that loads thumbnails
    from the hard drive and uploads them to a remote server.
    When bringing in large images, for example, when importing
    five 2MB files into Image objects:
    Flex reports that it is using 55MB
    Windows reports using 220 Meg (viewing memory usage of
    adl.exe in task manager)
    After deletion of these image objects, the memory stays
    allocated!! It is released when the application is closed.
    Two issues I see:
    1. Huge memory usage for image objects (I understand that JPG
    files are exploded into BMPs). It limits our ability to load 10's
    or 100's of images.
    2. Bad Memory leak
    OTHER THINGS WE TRIED:
    1. Displaying images as inline html IMG tags.. Same memory
    usage!
    2. Taking a snapshot of the image and displaying that.
    Problem, used way to much CPU
    I hope these issues will be fixed before release time or we
    are hosed.
    PLATFORM: Windows XP Professional, service pack 2

    Hi
    Have you tried the FB3 profiler to investigate why memory is
    not getting deallocated?
    You can use the loitering objects panel to track the back
    references for the objects in memory. If you find that image object
    is not being referenced by anything else. Can you file a bug at
    http://bugs.adobe.com/flex
    with a small test case.
    Also as you know that jpg will be translated into bitmap. The
    amount of memory required will be determined by the pixels in the
    image. Each pixel will be 4K
    Thanks,
    Gaurav Jain
    Flex SDK Team

  • Memory leak under GNU/Linux when using exec()

    Hi,
    We detected that our application was taking all the free memory of the computer when we were using intensively and periodically the method exec() to execute some commands of the OS. The OS of the computer is a GNU/Linux based OS.
    So, in order to do some monitoring we decided to wrote a simple program that called exec() infinite number of times, and using the profiler tool of Netbeans we saw a memory leak in the program because the number of surviving generations increased during all the execution time. The classes that have more surviving generations are java.lang.ref.Finalizer, java.io.FileDescriptor and byte[].
    We also decided to test this simple program using Windows, and in that OS we saw that the memory leak disappeared: the number of surviving generations was almost stable.
    I attach you the code of the program.
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    public class testExec
        public static void main(String args[]) throws IOException, InterruptedException
            Runtime runtime = Runtime.getRuntime();
            while (true)
                Process process = null;
                InputStream is = null;
                InputStreamReader isr = null;
                BufferedReader br = null;
                try
                    process = runtime.exec("ls");
                    //process = runtime.exec("cmd /c dir");
                    is = process.getInputStream();
                    isr = new InputStreamReader(is);
                    br = new BufferedReader(isr);
                    String line;
                    while ((line = br.readLine()) != null)
                        System.out.println(line);
                finally
                    process.waitFor();
                    if (is != null)
                        is.close();
                    if (isr != null)
                        isr.close();
                    if (br != null)
                        br.close();
                    if (process != null)
                        process.destroy();
    }¿Is anything wrong with the test program we wrote? (we know that is not usual to call infinite times the command ls/dir, but it's just a test)
    ¿Why do we have a memory leak in Linux but not in Windows?
    I will appreciate any help or ideas. Thanks in advance.

    Hi Joby,
    From our last profiling results, we haven't found yet a proper solution. We think that probably the problem is caused by the byte[]'s/FileInputStreams created by the class UNIXProcess that manage the stdin, stdout and stderr streams. It seems that these byte arrays cannot be removed correctly by the garbage collector and they become bigger and bigger, so at the end they took all the memory of the system.
    We downloaded the last version of OpenJDK 6 (build b19) and modified UNIXProcess.java.linux so when we call its method destroy(), we assign to null those streams. We did that because we wanted to indicate to the garbage collector that these objects could be removed, as we saw that the close() methods doesn't do anything on their implementation.
    public void destroy() {
         // There is a risk that pid will be recycled, causing us to
         // kill the wrong process!  So we only terminate processes
         // that appear to still be running.  Even with this check,
         // there is an unavoidable race condition here, but the window
         // is very small, and OSes try hard to not recycle pids too
         // soon, so this is quite safe.
         synchronized (this) {
             if (!hasExited)
              destroyProcess(pid);
            try {
                stdin_stream.close();
                stdout_stream.close();
                stderr_stream.close();
                // LINES WE ADDED
                stdin_stream = null;
                stdout_stream = null;
                stderr_stream = null;
            } catch (IOException e) {
                // ignore
                e.printStackTrace();
        }But this didn't work at all. We saw that we were able to execute for a long time our application and that the free memory of the system wasn't decreasing as before, but we did some profiling with this custom JVM and the test application and we still see more or less the same behaviour: lots of surviving generations, at some point increase of the used heap to the maximum allowed, and finally the crash of the test app.
    So sadly, we still don't have a solution for that problem. You could try to compile OpenJDK 6, modify it, and try it with your program to see if the last version works for you. Compiling OpenJDK 6 in Linux is quite easy: you just have to download the source and the binaries from here and configure your environment with something like this:
    export ANT_HOME=/opt/apache-ant-1.7.1/
    export ALT_BOOTDIR=/usr/lib/jvm/java-6-sun
    export ALT_OUTPUTDIR=/tmp/openjdk
    export ALT_BINARY_PLUGS_PATH=/opt/openjdk-binary-plugs/
    export ALT_JDK_IMPORT_PATH=/usr/lib/jvm/java-6-sun
    export LD_LIBRARY_PATH=
    export CLASSPATH=
    export JAVA_HOME=
    export LANG=C
    export CC=/usr/bin/gcc-4.3
    export CXX=/usr/bin/g++-4.3Hope it helps Joby :)
    Cheers.

  • Memory Leak while using -Xrunhprof option in Linux OS

    While using the follwing option in my application there is memory leak in JVM in Linux OS.
    -Xrunhprof:heap=all,cpu=times,monitor=y,file=/home/gemini/dilip/www2.log,thread=yIs this a bug ??

    Little lost here. Looks like you are facing memory leaks in Tuxedo 7.1 WS
    client code when it talks with Tuxedo 6.x? Is this correct?
    If so, try installing latest rolling patch for Tuxedo 7.1.
    We recently fixed couple of memory leaks in interop area. One was related to
    compression.
    _shailesh
    Scott Orshan <[email protected]> wrote in message
    news:[email protected]..
    If you are running with the latest patch, then report these problems to
    Support, giving them sample code so that they can reproduce the problem.
    Scott
    Thomas Winter wrote:
    Hi Scott,
    as an additional information:
    The guys at the server side changed something (their
    formaly useing the old 6.3 libraries at server side)
    and surprise... the client has no memory leak anymore.
    But, if more than one thread at the same time use the atmi calls
    there is still some memory consumption.
    The workaround is to use a mutex object to make sure, that
    only one thread use the atmi calls.
    AFAIS Tuxedo has an Problem with Multithreading.
    Thx
    Thomas

  • Detect memory leak in JNI so files for linux and Solaris

    I have to find the memory leaks in the JNI for solaris and linux but the issue is
    i need to find the leaks in the so files.I have solved the issues of leaks using Purify
    on windows but not getting appropriate support for linux. Any pointers to tools will help.I tried Valgrind on linux but it is not giving me the exact location of leak as in purify and also the support for purify is for 32 bit only.Valgrind is not showing any functions in .so files.JNI is not supported in Purify for Solaris? Please Help.

    amol28 wrote:
    I have to find the memory leaks in the JNI for solaris and linux but the issue is
    i need to find the leaks in the so files.I have solved the issues of leaks using Purify
    on windows but not getting appropriate support for linux. Any pointers to tools will help.I tried Valgrind on linux but it is not giving me the exact location of leak as in purify and also the support for purify is for 32 bit only.Valgrind is not showing any functions in .so files.JNI is not supported in Purify for Solaris? Please Help.If you have written the JNI, the JNI itself (java calls, methods, etc) to be OS agnostic then it shouldn't matter. In that case you check the windows code (not jni), the linux code (not jni) and the jni code itself independent of each other.
    If you haven't made the JNI OS agnostic the question would be why not?

  • Memory leak linux

    I'm running Ubuntu Linux and it looks like I see a memory leak that I'm not seeing when I ran it on my PC.
    I get heap exception everntually. I was using sam maxm heap size of 500M.
    Is there anything I have to do special for linux?
    Thanks

    morgalr wrote:
    Yes, my crystal ball says to fix the leak you observe in Linux, and it will fix any potential problem you have not viewed in Windows yet.(chuckle) Your comment expresses something that flicked through my mind even reading the title. The thought that flicked through my mind, did not quite have the eloquence of your words.

  • Scale Image Memory Leak

    There seems to be a memory leak in the Image.getScaledInstance(...) method when used in the following code:
    if(scanImage.getWidth(this) > scanImage.getHeight(this))
        scanImage =  scanImage.getScaledInstance(300, -1, Image.SCALE_DEFAULT);
    else
        scanImage =  scanImage.getScaledInstance(-1, 300, Image.SCALE_DEFAULT);
    }Any ideas why its leaking, or another way of doing scaling?

    hi
    memory problems with this method seem to be common. here is another way of scaling images:
    Iterator readers = ImageIO.getImageReadersByFormatName("gif");
    ImageReader reader = (ImageReader)readers.next();
    ImageInputStream iis = ImageIO.createImageInputStream(new File(path));               
    reader.setInput(iis, true);
    ImageReadParam param = reader.getDefaultReadParam();
    param.setSourceRenderSize(new Dimension(width, height));
    BufferedImage thumbnail = reader.read(0, param);
    this does not work for jpeg images and you need the sdk 1.4.2 in order to use ImageIO. previous versions do not have this framework.

Maybe you are looking for

  • Dynamic creation of context nodes and ui elements

    Hi, I have created context nodes dynamically. And i also want to create UI elements dynamically wherein i want to bind the attribute from the context node to it. For example i want to create a drop down by index and bind one of the attributes in the

  • JMS Adapter Configuration (Access JMS Provider Generically)

    Hi Exports, How can i configure JMS adapter Using Access JMS Provider Generically, where can we mentioned target server. there is Quename and username and password but there is no target server details field. could you please give me suggetion how to

  • Can't seem to connect to internet...confused!

    Hey guys, I bought a USB wireless device to allow me to connect to the internet with my MacPro (didn't come with an Airport card installed). It was one that I was assured would work and it has installed properly... The problem lies when I'm trying to

  • Parential Lockout in the Cloud issue

    I have a E4200 V2 recently upgraded to the Cloud.  Luv the new software.  One area I really liked is the new parental admin area which has more options regarding lockput time than the old non cloud software. There does though seem to be a problem wit

  • Temporary sequence numbers

    Hello all, Is there any provision in the mobile server and mobile client to synchronize the Lite database by using temporary sequence numbers for the newly added records? In the application that we are involved with, we are being asked to provide thi