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.

Similar Messages

  • Memory Leak on General Block when using Java Script

    Hi,
    I have a web view, that runs a html within the html there is a javascript which has a third party object this object displays some data and grows dynamically every time I invoke this object to grow I see in Instrument monitor whole bunch of Generalblock-256 ( 256 Bytes ) memory leak, I was wondering how can I manage this memory, I know in java script if we assign null to an object java will release it, but it's already reported the leak before I assign the object to null.
    Is there any way I can use let's say by NSAutoReleasePool.
    Thanks.

    The Memory leak is pretty much gone, with new release of OS 2.2.1 as apple has done better memory management for safari.

  • Tracking down a memory leak in LV8.2 when you can't use the profiler

    I am working with this large application. I have satisfied myself that it does have a memory leak by watching the Window's Task Manager while using the app.
    My first preference is to use the Profiler. However when I press 'Start' on the profiler, it instantly crashes LV. It does not do this for all VIs. I have tried to find the offending VI as narrowly as possible, but a VI that crashes profiler on one machine doesn't on another, so I gave that path up.
    If someone knows of a thread about the profiler crashing, please point me that way.
    Failing that, what kind of tips are there for tracking this leak down?
    Thanks!

    Hiya,
    Don't know of anything that will crash the profiler right off-hand, but it never struck me as the most... ah, robust bit of code in LV.
    As far as pre-existing tools, you could try the memmon.llb that lives in the National Instruments/<labview>/examples folder.  It should show the memory load of each vi in memory, though it may require a little retooling to get things into a view that you like.
    If you're on Windows, there are a number of tricks you can play with the SysInternals (now Microsoft) tools.  This usually boils down to watching lower level accesses to the operating system for patterns that look suspicious.  Not a high yield path, but occasionally it works.
    For methods, I like divide and conquer.  The more portions you can eliminate as NOT having the problem, the fewer portions of your code you have left to look for problems in.
    Tracking down memory leaks can be very difficult, but most show up in the end.
    Good bug hunting!
    Joe Z.

  • How can I prevent a memory flow error from occuring when using 3D contour plots?

    After displaying a single contour plot a number of times, LabVIEW crashes and reports a memory overflow error.  I only load a single 2D array, never storing previouls ones. I always index the data for contour plot 0, and don't explicitly store multiple 2D arrays in any buffer, such as appending data to a shift register.  There appears to be some sort of memory leak in LV when using this feature.  Is there a programatic way to flush the stored data in a contour plot prior to displaying the next 2D array of data?

    Hello MicTomReiSr,
    Is this in the LabVIEW development environment?  Are you making changes to the code and then running the VI?  Does the plot contain default data? Is the indicator cleared when the program stops?  The Plot Clean Data method may be what you're looking for.
    Remember that the development environment maintains an undo history of the changes you've made, and copies both the block diagram and FP contents each time.  If you have a lot of data displayed on the front panel you end up copying it multiple times.  This isn't a problem unless you're actively editing the VI in question.
    If you do need to edit and run the VI at the same time (perfectly reasonable, although you might want to consider a 64-bit installation or more RAM if you commonly work with resource-intensive data types like 3D plots) try reducing the Undo history length (Tools>>Options), although be aware that you won't be able to back up as many steps.
    Regards,
    Tom L.

  • Memory Leak in Preview.app when switching Display Profiles

    I found a weird memory leak in Max OS X Preview.app, which manifests itself when Display profiles (color calbration) is change. I wonder if anyone else can reproduce my experience.
    1. Open up "System Preferences" -> "Displays", switch to the "Color" tab. You'll need at least 2 available profiles in the list. (If you only have 1, you can create another using "Calibrate..." button to launch Display Calibration Assistant.
    2. Open an image file in Preview.app.  The larger, the better. Zoom in full size to maximize the effect of the bug. I repro'ed easily with this image: http://www.donporter.net/NewSchool/Color/Examples/Printer%20Test%20file.jpg
    3. Open up "Activity Monitor.app", and click on Preview to highlight it, so you can watch its memory usage.
    4. Switch back to "Diplays" Preference Pane. Using the arrow keys, toggle up and down between two different Display profiles.
    4a. At the same time, watch Preview's "Real Mem" in Activity Monitor, as well as the total "Active" memory.
    5. Each time you switch profiles,  Preview consumes more Active/Real memory, about 25MB per switch in my case. This continues until all physical memory is consumed, and then (I presume) starts swapping virtual memory to disk.
    6. Bring Preview to  foreground, and all the profile-induced memory usage is freed.
    Weird, wild stuff.

    Could it be possible that this is just the OS holding the memory for the app until another process requires it?  Do you find that the memory increase eventually causes the app to become unstable? 
    It might be best to open a new bug report on this over at bugbase.adobe.com.  When adding the bug, please include any source code, project or installer that will help us reproduce the issue internally.  If you'd like to keep your code private, feel free to email it directly to [email protected]  Once entered, please post back with the URL so that others effected can add their comments and votes.
    Thanks,
    Chris

  • Getting core dump when using EXEC SQL CLOSE

    In my pro*c program , i have used a cursor to fetch the set of accounts.Once cursor is opened , code will perform set
    of operation using fetched data and then cursor is closed. Between open and closing of cursor , i have used 23 EXEC
    SQL CLOSE. For example i am copying the value of a to b using strlcpy between fetch and close cursor statement.If
    returned value from strlcpy is greater than size of destination variable, then flow should not proceed , in that case I will
    close the cursor using EXEC SQL CLOSE and return the flow to calling program. Similarly i have closed the cursor at
    another 22 locations.
    When i compile the code and run binary the core dump occurs. On analyzing the core it shows
    t@null (l@8) terminated by signal SEGV (no mapping at the fault address)
    0xffffffffffffffff: <bad address 0xffffffffffffffff>
    dbx: core file read error: address 0xfc4ffe48 not in data space
    Current function is dbMtBaseClass::Pswd_Change
    7860 sqlcxt(&_dbMtCtx, &sqlctx, &sqlstm, &sqlfpn);
    if I remove any of the three EXEC SQL CLOSE commands , core dump does not occurs.
    It looks strange.Please help me to resolve the issue.

    In my pro*c program , i have used a cursor to fetch the set of accounts.Once cursor is opened , code will perform set
    of operation using fetched data and then cursor is closed. Between open and closing of cursor , i have used 23 EXEC
    SQL CLOSE. For example i am copying the value of a to b using strlcpy between fetch and close cursor statement.If
    returned value from strlcpy is greater than size of destination variable, then flow should not proceed , in that case I will
    close the cursor using EXEC SQL CLOSE and return the flow to calling program. Similarly i have closed the cursor at
    another 22 locations.
    When i compile the code and run binary the core dump occurs. On analyzing the core it shows
    t@null (l@8) terminated by signal SEGV (no mapping at the fault address)
    0xffffffffffffffff: <bad address 0xffffffffffffffff>
    dbx: core file read error: address 0xfc4ffe48 not in data space
    Current function is dbMtBaseClass::Pswd_Change
    7860 sqlcxt(&_dbMtCtx, &sqlctx, &sqlstm, &sqlfpn);
    if I remove any of the three EXEC SQL CLOSE commands , core dump does not occurs.
    It looks strange.Please help me to resolve the issue.

  • CVI under W2K crashes when using stop in debug mode and AOGenerateWaveforms

    When using AOGenerateWaveforms to generate a sine wave. If you hit stop in debug the PC restarts. If you're using the same channel to generate a DC signal, it's fine. Seems to be the card accessing the dynamic memory I've set the waveform up in after you hit stop and the memory has been free'd.

    This is sometimes the nature of the beast. When your program is running you are doing DMA transfers to locations in memory that have been setup by your operating system. Now if you stop your program, with out killing or stopping the DAQ device it will cause you problems in some cases. You need to call AOClearWaveforms before you stop your program.
    If you do not stop the DAQ device, before stopping your program it will cause the DAQ device to write to memory that is no longer allocated for that process. In most cases windows detects this as an error and reboots the system, because it thinks a program has crashed and is now writing to memory locations out of its designated space.
    I hope this helps.
    Joshua

  • Memory leak in a function registered using set_restore_function()

    I experience a problem with memory leak caused by the following function:
    void RestorePhonemesSet(PhonemesSetStructType &phonemesSet, const void *src) {
    char p = (char ) src;
    memcpy(&phonemesSet.len, p, sizeof (int));
    p += sizeof (int);
    memcpy(&phonemesSet.whichFile, p, sizeof (int));
    p += sizeof (int);
    memcpy(&phonemesSet.whichPosition, p, sizeof (int));
    p += sizeof (int);
    phonemesSet.phonemes = (int *)malloc(sizeof(int)*phonemesSet.len);
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ here the problematic code
    memcpy(phonemesSet.phonemes, p, sizeof (int) * phonemesSet.len);
    This function is registered using a following call: DbstlElemTraits<PhonemesSetStructType>::instance()->set_restore_function(RestorePhonemesSet);
    The culprit it the malloc memory allocation. If I leave out the malloc the program crashes. If I free the phonemeSet.phonemes memory segment at the end of the restore function I lost data, and if I use the malloc there is a large memory leak while reading every record from the database.
    What should I do to prevent the memory leak?
    Regards,
    markur
    Edited by: 904259 on 2011-12-24 05:42

    the solution is using the memory allocated for p, no need to allocate new memory space for the variable: the problematic line should look like .phonemes = (int *)p;
    the memcpy function in the following line is thus superfluous.
    Edited by: 904259 on 2011-12-24 05:43

  • Memory Leak in web application created using j2ee

    Hi,
    Our company has one web application, provided by "X" vendor. this application has many JSPs and many TLDs used. The basic behaviour of the apoplication is to connect to the database (Oracle) get the information and show it to the user.
    We deployed this web application in Tomcat 5.0.25 in the windows environment. One thing we observed here is, when we login to the application the tomcat5.exe process increses its memory. and when we logout, it does not come down to the original position. similar things happen when we search for some of the data using there provided searches.
    We have some code developed which uses httpclient to login to this web application (created for performace testing). This code initially logs in 50 users which goes fine, then logs in 100 users which also goes fine but after this 100 users we ran the code for 50 users agian but this time it threw OutOfmemory exception:Java heap space error.
    we are observing the memory in the Task Manager in windows.
    Can anyone tell me what could be the cause of this? is it the web application causing problem or is tomcat caching some pages into the memory and is not releasing them?

    Hi,
    Few questions!
    1> Have you tweaked your jvm?
    2> What are the values given for Xms and Xmx?
    3> What is the size of XX:MaxPermGen?
    4> How much RAM is available on the system where you have deployed your app?
    5> Are you using pre-complied JSPs for faster response?
    6> Which JDK are you using?
    7> Have you tried using latest version of Tomcat?
    8> If these doesnt help, use any profiler to find the leak. <JProfiler, JVMTI, YourKit profiler etc>
    I hope answering these questions would help you :)
    njoy!

  • Memory management / Memory Leak under KDE 4.2?

    If I should do something a little more structured to check this out, I'm open to suggestions.  I'm mostly hoping to confirm or deny this behavior with others.
    For context -- I've been using GNOME with Arch on this hardware since mid-December (when I first installed Arch) until last week.  Since then I've been using KDE 4.2.  Prior to Arch, I'd run GNOME under several distros on this same hardware as well.  During all this time I've had conky or some screenlet or whatever indication running to show me RAM usage (like a lot of us do).   It's one of those things that I don't think about much, but notice when it's different than I expect.
    I have 3GB RAM, and under GNOME the only time I ever saw it approach or pass 1GB used was when I knew I was doing memory intensive things (VM running + other tasks)
    Under GNOME I was seeing about 300-350MB used at startup, or if I'd close down every windowed app or anything I was doing at any given point in time.
    KDE 4.2 seems to start up with about 350-450, which is fine.
    Here's my issue, and it's confusing to me, possibly due to my lack of understanding regarding memory management.
    Over time in KDE 4.2, as reported by conky or various monitoring widgets I've had running, my memory usage will gradually creep up until just about all my RAM is shown as in use.  This doesn't take long, say 1-2 hours.  I also don't have to be doing anything special during that time.  I haven't tested to see if it will creep up with me doing nothing, but I definitely DON'T have to do memory hungry tasks for this to happen.
    Interestingly, the KDE system monitor shows a more reasonable amount, usually.  Currently my widget is reporting 2162MB used, with 1640 cached, and the only thing I have open is this firefox window.  (And no, firefox is not using 2GB of RAM)  Checking the system monitor shows no excessive RAM consumption by any process, and .48GB used.   
    Now you might think "Just subtract out the cached RAM, which isn't hurting anything, and you get a number that jives with System Monitor."  That's true, but I have two problems with that:
    1) Why did I never see anythign like this under GNOME?
    2) When my used RAM as shown by the widget gets extremely high like this, I start using *SWAP*.  I can tell you for certain that my swap usage was at zero for all the time I've had this computer prior to using KDE 4.2 these last few days.  Currently I'm using 64MB of swap -- not much, but why am I using any?  And, I know that if I don't reboot soon, that number will also start to grow, though more slowly.
    I used to run munin just for fun, maybe I should start doing that again just to get some hard data...
    Any ideas?
    Last edited by arch_nemesis (2009-02-03 08:30:16)

    arch_nemesis wrote:
    Interestingly, the KDE system monitor shows a more reasonable amount, usually.  Currently my widget is reporting 2162MB used, with 1640 cached, and the only thing I have open is this firefox window.  (And no, firefox is not using 2GB of RAM)  Checking the system monitor shows no excessive RAM consumption by any process, and .48GB used.   
    Now you might think "Just subtract out the cached RAM, which isn't hurting anything, and you get a number that jives with System Monitor."  That's true, but I have two problems with that:
    1) Why did I never see anythign like this under GNOME?
    KDE .. probably nepomuk .. is touching much more files on the hard disk than GNOME, thus making the kernel cache them (that's good).
    64MB of  swap is nothing, the defaults behaviour of the kernel is to swap some very  rare used programs (login perhaps) in order to have more RAM free for cache. The swapiness nob controls the behaviour (http://kerneltrap.org/node/3000).
    Summary: you are really only using 480MB ram

  • Memory leak? amd 64 bit using 1.4.2_03 program runs fine on other computers

    I have a program that runs fine on a red hat linux desktop and a pentium 1.6ghz xp pro laptop but on my amd 64 bit 3400+ xp pro desktop after ~20 seconds it slows to a crawl. i was originally using j2sdk1.4.2_04 but noticed this was not available for download anymore so i switched to j2sdk1.4.2_03 but have the same problem. my laptop is using j2sdk1.4.2_03. im not sure what the red hat linux machine is using. this is a starfield simulator and when it starts to slow all the stars turn gray and its like the drawLine is not working right either. anyone have any ideas? code is below
    import java.awt.*;
    import java.awt.event.WindowListener;
    import java.awt.event.WindowEvent;
    import java.util.*;
    import javax.swing.*;
    import java.io.*;
    class StarfieldWindowListener implements WindowListener
    public void windowActivated( WindowEvent e ) {}
    public void windowClosed( WindowEvent e ) {}
    public void windowClosing( WindowEvent e )
    System.exit(0);
    public void windowDeactivated( WindowEvent e ) {}
    public void windowDeiconified( WindowEvent e ) {}
    public void windowIconified( WindowEvent e ) {}
    public void windowOpened( WindowEvent e ) {}
    public class StarfieldSimulator
         public static void main (String args[])
              JFrame frame = new JFrame ("Starfield Simulator");
              frame.getContentPane ().setLayout (new BorderLayout ());
              if (args.length == 0) frame.getContentPane ().add (new Starfield (500));
              else frame.getContentPane ().add (new Starfield (Integer.parseInt (args[0])));
    frame.addWindowListener(new StarfieldWindowListener());
              frame.setSize (1024, 768);
              frame.show ();
    class Point3D
         public double x, y, z;
    public float r, g, b;
    public Color c;
         public Point3D (double x, double y, double z)
    Random random = new Random ();
              this.x = x;
              this.y = y;
              this.z = z;
    r = random.nextFloat();
    g = random.nextFloat();
    b = random.nextFloat();
    c = new Color( r, g, b );
    class Starfield extends JComponent
         protected boolean first;
         protected Point3D points[][];
         protected Random random;
         private int trail = 20;
    private double rot = .0005, co = Math.cos( rot ), si = Math.sin( rot );
         public Starfield (int numPoints)
    //RepaintManager repaintManager = RepaintManager.currentManager(this); repaintManager.setDoubleBufferingEnabled(false);
              first = true;
              random = new Random ();
              points = new Point3D[numPoints][trail];
              for( int y = 0; y < numPoints; ++y )
                   for( int x = 1; x < trail; ++x )
                        points[y][x] = new Point3D( 0, 0, 0 );
              for (int index = 0; index < numPoints; index++)
                   points[index][0] = new Point3D ((random.nextDouble () - 0.5) * 2.0, (random.nextDouble () - 0.5) * 2.0, (random.nextDouble () - 0.5) * 2.0);
         public void paint (Graphics g)
    //DebugGraphics g = new DebugGraphics(g1);
    int i;
              int halfWidth = getWidth () / 2;
              int halfHeight = getHeight () / 2;
              g.setColor (Color.black);
              g.fillRect (0, 0, getWidth (), getHeight ());
              int pointsLength = points.length;
              for (int index = 0; index < pointsLength; index++)
                   for( i = trail - 1; i >= 1; --i )
                        points[index] = points[index][i - 1];
    if( points[index][0].z <= 0.0 )
    while (points[index][0].z <= 0.0) points[index][0] = new Point3D ((random.nextDouble () - 0.5) * 2.0, (random.nextDouble () - 0.5) * 2.0, (random.nextDouble () - 0.5) * 2.0);
    points[index][0].r = random.nextFloat();
    points[index][0].g = random.nextFloat();
    points[index][0].b = random.nextFloat();
    for( i = 1; i < trail; ++i )
    points[index][i].x =points[index][i].y = points[index][i].z = 0;
    g.setColor (points[index][0].c);
                   for( i = 0; i < trail; ++i )
                        points[index][i].x = points[index][i].x * co - points[index][i].y * si;
                        points[index][i].y = points[index][i].y * co + points[index][i].x * si;
    int sx1, sy1, sx2, sy2;
    sx1 = (int) ((points[index][0].x * halfWidth) / ((points[index][0].z) * 10.0)) + halfWidth;
    sy1 = (int) ((points[index][0].y * halfHeight) / ((points[index][0].z) * 10.0)) + halfHeight;
    if( points[index][(trail - 1)].z == 0 )
    g.drawRect( sx1, sy1, 1, 1 );
    else
    sx2 = (int) ((points[index][(trail - 1)].x * halfWidth) / ((points[index][(trail - 1)].z + .0005 * (trail - 1)) * 10.0)) + halfWidth;
    sy2 = (int) ((points[index][(trail - 1)].y * halfHeight) / ((points[index][(trail - 1)].z + .0005 * (trail - 1)) * 10.0)) + halfHeight;
    g.drawLine( sx1, sy1, sx2, sy2 );
    points[index][0].r = (float) Math.min ( points[index][0].r + .00005, 1.0 );
    points[index][0].g = (float) Math.min ( points[index][0].g + .00005, 1.0 );
    points[index][0].b = (float) Math.min ( points[index][0].b + .00005, 1.0 );
    points[index][0].c = new Color( points[index][0].r, points[index][0].g, points[index][0].b );
                   points[index][0].z -= 0.0025;
    try {
    Thread.sleep(1);
    } catch (InterruptedException e) {
    e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
    repaint();

    doesnt ANYONE have an answer?? please?Apparently not. If the answer involves us typing in your program, understanding it, debugging it, etc., hey, we all have jobs, too. We can answer specific questions ("How do I do <some specific task>?" or "I tried this and that <specific task> but ran into <specific problem>"). But we don't have all day to debug everyone's programs.
    * First of all, use the code formatting markup around your code (See the Formatting Help link).
    * Secondly, tell us what you have tried - have you looked at your Task Manager and recorded your program's size? Compare it on the machines where it runs well, and the one where it doesn't.

  • Memory leak in explict\images\content\used

    Since about a week ago my girlfriend's Firefox 19.0.2 started to crash with low memory message. She's using a laptop with 3 gig of memory and Windows 7 32. Her add-ons are adblock, WeatherBug and some spellcheckers.
    I reinstalled her browser and also installed Memory Fox plugin. It didn't help. Crashes occur once in one or two days after several hours of browsing.
    I asked her to save the "about:memory" page when the low memory message appears. These are the first lines:
    1,347.68 MB (100.0%) -- explicit
    ├──1,007.93 MB (74.79%) -- images
    │ ├──1,007.71 MB (74.77%) -- content
    │ │ ├──1,007.65 MB (74.77%) -- used
    │ │ │ ├────601.40 MB (44.62%) ── raw
    │ │ │ ├────361.11 MB (26.79%) ── uncompressed-nonheap
    │ │ │ └─────45.14 MB (03.35%) ── uncompressed-heap
    │ │ └──────0.06 MB (00.00%) ++ unused
    │ └──────0.22 MB (00.02%) ++ chrome
    She also sent me the page just after she started Firefox (with her pinned tabs) and there are no such memory figures.
    Unfortunately I can't be more specific. She can't say if she changed something recently and she's also unable to cause it to happen when I am there.

    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!

  • Null Pointer Exception when using exec() method of runtime.

    Hi There,
    I am using a Random Access File to access text data. Then I am using the text data with the Runtime class to activate native programs (such as Word, Outlook, etc).
    I have designed my code so that the length of the text file is compared to the current file pointer. If the current file pointer is less than the length of the file then a string is loaded with the text (path) details relevant for the activation of a program (e.g.: Word). In the case where the end of text data in the file has been reached I load the relevant string with null. Here is a little run down of the code:
    String Path1;
    long FileLength = TxtFile.length(); //Find file length.
    long PointerPosition = TxtFile.getFilePointer(); //Find current position
      try
          if(PointerPosition < FileLength)
            Path1 = TxtFile.readLine();        //Read line into string
          else
            Path1 = null;                      //Make string null.
       }catch(IOException e){}Once the code above has been run I then use the Runtime class's exec() method along with path details held in the string to start a native program as follows:
        if(e.getActionCommand().equals("Word"))
          if(Path1.equals(null))
            EntryBox = new DataEntryBox();  //Create a dialog box for user.
          else
            try
              Runtime.getRuntime().exec(new String[]{Path1}); //Starts prog
            catch(IOException f){}
        }Whenever I press a button on my program that does not contain a path and instead contains the null value for the relevant string I get the following error message:
    C:\j2sdk1.4.0\bin\javaw -classpath "D:\Java\JavaQuickLauncher\classes;C:\j2sdk1.4.0\jre\lib\charsets.jar;C:\j2sdk1.4.0\jre\lib\jaws.jar;C:\j2sdk1.4.0\jre\lib\jce.jar;C:\j2sdk1.4.0\jre\lib\jsse.jar;C:\j2sdk1.4.0\jre\lib\rt.jar;C:\j2sdk1.4.0\jre\lib\sunrsasign.jar;C:\j2sdk1.4.0\jre\lib\ext\dnsns.jar;C:\j2sdk1.4.0\jre\lib\ext\ldapsec.jar;C:\j2sdk1.4.0\jre\lib\ext\localedata.jar;C:\j2sdk1.4.0\jre\lib\ext\sunjce_provider.jar;C:\j2sdk1.4.0\lib\dt.jar;C:\j2sdk1.4.0\lib\htmlconverter.jar;C:\j2sdk1.4.0\lib\tools.jar;C:\j2sdk1.4.0\demo\plugin\jfc\Java2D\Java2Demo.jar;C:\j2sdk1.4.0\demo\jfc\Java2D\Java2Demo.jar" javaquicklauncher.Begin
    java.lang.NullPointerException
         at javaquicklauncher.GUI.actionPerformed(GUI.java:160)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1767)
         at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1820)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:419)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:257)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:258)
         at java.awt.Component.processMouseEvent(Component.java:5021)
         at java.awt.Component.processEvent(Component.java:4818)
         at java.awt.Container.processEvent(Container.java:1380)
         at java.awt.Component.dispatchEventImpl(Component.java:3526)
         at java.awt.Container.dispatchEventImpl(Container.java:1437)
         at java.awt.Component.dispatchEvent(Component.java:3367)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3214)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2929)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2859)
         at java.awt.Container.dispatchEventImpl(Container.java:1423)
         at java.awt.Window.dispatchEventImpl(Window.java:1566)
         at java.awt.Component.dispatchEvent(Component.java:3367)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:445)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:190)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:144)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:130)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:98)
    It is my feeling that the exec() method of Runtime is causing this ream of errors, however I feel that my test condition -- if(Path1.equals(null)) -- should avoid trying to run the exec() method when the string is truly null. I am really stuck with this one, any help / suggestions will be greatly appreciated.
    Thanks for your time.

    Path.equals(null) ... and if the Path is null u ll get a NullPointerException.
    U r trying to do an equals on null.

  • How can I run a Flash Projector(exe) under GNU/Linux without wine?

    I was received a flash on projector type(exe), there's no another swf file on there.
    I'd like to ask: How can I run that on a Linux?
    Thanks for reading and paying attention.

    This sounds like a question for the linux distribution forum that you're using.  The .exe is a stand alone executable, if you can run win32 binaries then you should be able to run this.
    Thanks,
    Chris

  • Memory Leakage in IE7 & firefox when using SpryData

    Hi,
    I am trying to figure out what have I done wrong in the code
    below so that the memory is not freeing in the browser and it keeps
    growing until I close it. I am polling every 3 seconds, and each
    time it polls, the memory increases.
    I appreciate your help.
    <script type="text/javascript">
    var dsresults = new
    Spry.Data.XMLDataSet("/etradetest/ar/accounts/portfoliogen.jsp",
    "/RESULTS/PRODUCT",{useCache:false,loadInterval:3000})
    var dstotals = new
    Spry.Data.XMLDataSet("/etradetest/ar/accounts/portfoliogen.jsp",
    "/RESULTS/TOTALS",{useCache:false,loadInterval:3000});
    </script>
    <div spry:region="dsresults dstotals"
    class="SpryHiddenRegion">
    <table border="1" width="100%" style="font-size:11px;"
    cellspacing="1" cellpadding="4" >
    <tr>
    <td width="150px"
    style="font-size:13px;font-weight:bold;text-align:right;background-color:#000;color:
    #FFF"> {dstotals::@t4}</td>
    <td width="80px"
    style="font-weight:bold;text-align:left;color: #0066FF"
    >&#1575;&#1604;&#1585;&#1589;&#1610;&#1583;
    &#1575;&#1604;&#1605;&#1581;&#1580;&#1608;&#1586;</td>
    <td width="150px"
    style="font-size:13px;font-weight:bold;text-align:right;background-color:#000;color:
    #FFF">{dstotals::@t5}</td>
    <td width="75px"
    style="font-weight:bold;text-align:left;color:
    #0066FF">&#1575;&#1604;&#1585;&#1589;&#1610;&#1583;
    &#1575;&#1604;&#1606;&#1602;&#1583;&#1610;</td>
    <td width="150px"
    style="font-size:13px;font-weight:bold;text-align:right;background-color:#000;color:
    #FFF;" >{dstotals::@t6}</td>
    <td dir="RTL" width="50px"
    style="font-weight:bold;text-align:right;color:
    #0066FF;">&#1573;&#1580;&#1605;&#1575;&#1604;&#1610;</td>
    </tr>
    </table>
    <table width="100%" border="0" cellspacing="0"
    cellpadding="2" >
    <thead>
    <tr class="dynamicportfolio">
    <th>&#1575;&#1604;&#1588;&#1585;&#1603;&#1577;</th>
    <th>&#1575;&#1604;&#1603;&#1605;&#1610;&#1577;</th>
    <th>&#1575;&#1604;&#1603;&#1605;&#1610;&#1577;&#32;&#1575;&#1604;&#1605;&#1593;&#1585;&#1 608;&#1590;&#1577;</th>
    <th>&#1575;&#1604;&#1603;&#1605;&#1610;&#1577;&#32;&#1575;&#1604;&#1605;&#1578;&#1608;&#1 601;&#1585;&#1577;</th>
    <th>&#1605;&#1593;&#1583;&#1604;&#32;&#1575;&#1604;&#1578;&#1603;&#1604;&#1601;&#1577;</t h>
    <th>&#1570;&#1582;&#1585;</th>
    <th>&#1573;&#1580;&#1605;&#1575;&#1604;&#1610;&#32;&#1575;&#1604;&#1578;&#1603;&#1604;&#1 601;&#1577;</th>
    <th>&#1575;&#1604;&#1602;&#1610;&#1605;&#1577;
    &#1575;&#1604;&#1587;&#1608;&#1602;&#1610;&#1577;</th>
    <th>&#1575;&#1604;&#1585;&#1576;&#1581;/
    &#1575;&#1604;&#1582;&#1587;&#1575;&#1585;&#1577;</th>
    </tr>
    </thead>
    <tr spry:repeat="dsresults" align="right">
    <td spry:even="odd" spry: spry:odd="even"><a
    style="color:#FFF;font-size:14px"
    href="{NAME/@href}">{NAME}</a></td>
    <td spry:even="odd" spry:odd="even">{QTY}</td>
    <td spry:even="odd"
    spry:odd="even">{OUTSTANDUNITS}</td>
    <td spry:even="odd"
    spry:odd="even">{AVAILABLEUNITS}</td>
    <td spry:even="odd"
    spry:odd="even">{AVGCOST}</td>
    <td spry:even="odd"
    spry:odd="even">{LASTPRICE}</td>
    <td spry:even="odd"
    spry:odd="even">{STOCKCOST}</td>
    <td spry:even="odd"
    spry:odd="even">{MARKETVALUE}</td>
    <td spry:even="odd" spry:odd="even"
    spry:if="'{GAINLOSS/@style}'.match(/^RED$/);" style="color:
    red;">{GAINLOSS}</td>
    <td spry:even="odd" spry:odd="even"
    spry:if="'{GAINLOSS/@style}'.match(/^GREEN$/);" style="color:
    green;">{GAINLOSS}</td>
    </tr>
    <tr class="footer">
    <td colspan="6" align="right" ></td>
    <td align="right">{dstotals::@t1}</td>
    <td align="right" >{dstotals::@t2}</td>
    <td align="right">{dstotals::@t3}</td>
    </tr>
    </table>

    this is the data being returned from portfoliogen.jsp:
    <RESULTS>
    <PRODUCT>
    <NAME
    href="javascript:popupWindow('/etradetest/ar/product/productdetail.jsp?productid=2350&amp ;productname=StockA">StockA</NAME>
    <QTY>1</QTY>
    <PLEDGEDUNITS>0</PLEDGEDUNITS>
    <OUTSTANDUNITS>0</OUTSTANDUNITS>
    <AVAILABLEUNITS>1</AVAILABLEUNITS
    <AVGCOST>25.75</AVGCOST>
    <LASTPRICE>28.25</LASTPRICE>
    <STOCKCOST>25.75</STOCKCOST>
    <MARKETVALUE>28.25</MARKETVALUE>
    <GAINLOSS style="GREEN">2.50</GAINLOSS>
    </PRODUCT>
    <PRODUCT>
    <NAME
    href="javascript:popupWindow('/etradetest/ar/product/productdetail.jsp?productid=5110&amp ;productname=StockB)"
    >StockB</NAME>
    <QTY>2</QTY>
    <PLEDGEDUNITS>0</PLEDGEDUNITS>
    <OUTSTANDUNITS>0</OUTSTANDUNITS>
    <AVAILABLEUNITS>2</AVAILABLEUNITS>
    <AVGCOST>23.75</AVGCOST>
    <LASTPRICE>14.50</LASTPRICE>
    <STOCKCOST>47.50</STOCKCOST>
    <MARKETVALUE>29.00</MARKETVALUE>
    <GAINLOSS style="RED">-18.50</GAINLOSS>
    </PRODUCT>
    <TOTALS t1="73.25" t2="57.25" t3=" &lt;Font
    color=&quot;#E42217&quot;&gt;-16.00&lt;/Font&gt;"
    t4="0.00" t5="26.75" t6="84.00"/>
    </RESULTS>
    This is the page that is using the spry:
    <html>
    <head>
    <title>&#1601;&#1575;&#1604;&#1603;&#1605;
    &#1604;&#1604;&#1582;&#1583;&#1605;&#1575;&#1578;
    &#1575;&#1604;&#1605;&#1575;&#1604;&#1610;&#1577;</title>
    <script language="javascript">
    if(history.length>0)history.go(+1);
    </script>
    <script src="/etradetest/lib/xpath.js"
    type="text/javascript"></script>
    <script src="/etradetest/lib/SpryData.js"
    type="text/javascript"></script>
    <script type="text/javascript">
    var dsresults = new
    Spry.Data.XMLDataSet("/etradetest/ar/accounts/portfoliogen.jsp",
    "/RESULTS/PRODUCT",{useCache:false,loadInterval:3000})
    var dstotals = new
    Spry.Data.XMLDataSet("/etradetest/ar/accounts/portfoliogen.jsp",
    "/RESULTS/TOTALS",{useCache:false,loadInterval:3000});
    </script>
    <body leftmargin="3" topmargin="0" rightmargin="2"
    bgcolor="#000">
    <div spry:region="dsresults dstotals"
    class="SpryHiddenRegion" DIR="RTL">
    <table border="1" width="100%" style="font-size:11px;"
    cellspacing="1" cellpadding="4">
    <tr>
    <td width="50px"
    style="font-weight:bold;text-align:right;color:
    #0066FF;">&#1573;&#1580;&#1605;&#1575;&#1604;&#1610;</td>
    <td width="150px"
    style="font-size:13px;font-weight:bold;text-align:right;background-color:#000;color:
    #FFF;" >{dstotals::@t6}</td>
    <td width="75px"
    style="font-weight:bold;text-align:left;color:
    #0066FF">&#1575;&#1604;&#1585;&#1589;&#1610;&#1583;&#1575;&#1604;&#1606;&#1602;&#1583;&#1 610;</td>
    <td width="150px"
    style="font-size:13px;font-weight:bold;text-align:right;background-color:#000;color:
    #FFF">{dstotals::@t5}</td>
    <td width="80px"
    style="font-weight:bold;text-align:left;color: #0066FF"
    >&#1575;&#1604;&#1585;&#1589;&#1610;&#1583;
    &#1575;&#1604;&#1605;&#1581;&#1580;&#1608;&#1586;</td>
    <td width="150px"
    style="font-size:13px;font-weight:bold;text-align:right;background-color:#000;color:
    #FFF"> {dstotals::@t4}</td>
    </tr>
    </table>
    <table width="100%" border="0" cellspacing="0"
    cellpadding="2" >
    <thead>
    <tr class="dynamicportfolio">
    <th>&#1575;&#1604;&#1588;&#1585;&#1603;&#1577;</th>
    <th>&#1575;&#1604;&#1603;&#1605;&#1610;&#1577;</th>
    <th>&#1575;&#1604;&#1603;&#1605;&#1610;&#1577;&#32;&#1575;&#1604;&#1605;&#1593;&#1585;&#1 608;&#1590;&#1577;</th>
    <th>&#1575;&#1604;&#1603;&#1605;&#1610;&#1577;&#32;&#1575;&#1604;&#1605;&#1578;&#1608;&#1 601;&#1585;&#1577;</th>
    <th>&#1605;&#1593;&#1583;&#1604;&#32;&#1575;&#1604;&#1578;&#1603;&#1604;&#1601;&#1577;</t h>
    <th>&#1570;&#1582;&#1585;</th>
    <th>&#1573;&#1580;&#1605;&#1575;&#1604;&#1610;&#32;&#1575;&#1604;&#1578;&#1603;&#1604;&#1 601;&#1577;</th>
    <th>&#1575;&#1604;&#1602;&#1610;&#1605;&#1577;
    &#1575;&#1604;&#1587;&#1608;&#1602;&#1610;&#1577;</th>
    <th>&#1575;&#1604;&#1585;&#1576;&#1581;/
    &#1575;&#1604;&#1582;&#1587;&#1575;&#1585;&#1577;</th>
    </tr>
    </thead>
    <tr spry:repeat="dsresults" align="right">
    <td spry:even="odd" spry: spry:odd="even"><a
    style="color:#FFF;font-size:14px"
    href="{NAME/@href}">{NAME}</a></td>
    <td spry:even="odd" spry:odd="even">{QTY}</td>
    <td spry:even="odd"
    spry:odd="even">{OUTSTANDUNITS}</td>
    <td spry:even="odd"
    spry:odd="even">{AVAILABLEUNITS}</td>
    <td spry:even="odd"
    spry:odd="even">{AVGCOST}</td>
    <td spry:even="odd"
    spry:odd="even">{LASTPRICE}</td>
    <td spry:even="odd"
    spry:odd="even">{STOCKCOST}</td>
    <td spry:even="odd"
    spry:odd="even">{MARKETVALUE}</td>
    <td spry:even="odd" spry:odd="even"
    spry:if="'{GAINLOSS/@style}'.match(/^RED$/);" style="color:
    red;">{GAINLOSS}</td>
    <td spry:even="odd" spry:odd="even"
    spry:if="'{GAINLOSS/@style}'.match(/^GREEN$/);" style="color:
    green;">{GAINLOSS}</td>
    </tr>
    <tr class="footer">
    <td colspan="6" align="right" ></td>
    <td align="right">{dstotals::@t1}</td>
    <td align="right" >{dstotals::@t2}</td>
    <td align="right">{dstotals::@t3}</td>
    </tr>
    </table>
    </div>
    </body>
    </html>
    Now everything is working as they should be, but it is eating
    up memory. Nothing special in the code, just followed the samples
    provided by Adobe.
    Note that I modified the data by changing the name tag to
    StockA and StockB while in fact they are written in Arabic.

Maybe you are looking for