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.

Similar Messages

  • Running windows 7 with plenty of memory.when i use the smart brush program is fine but when i start to use detail smart brush program shuts down,PLEASE ADVISE

    running windows 7 with plenty of memory.when i use the smart brush program is fine but when i start to use detail smart brush program shuts down,PLEASE ADVISE what corrective actions need done
    thank you

    You should post that on the Boot Camp  forum, that is where all the Boot Camp and Windows guys hang out.
    Good luck.

  • I think I've got a memory leak and could use some advice

    We've got ourselves a sick server/application and I'd like to gather a little community advice if I may. I believe the evidence supports a memory leak in my application somewhere and would love to hear a second opinion and/or suggestions.
    The issue has been that used memory (as seen by FusionReactor) will climb up to about 90%+ and then the service will start to queue requests and eventually stop processing them all together. A service restart will bring everything back up again and it could run for 2 days or 2 hours before the issue repeats itself. Due to the inconsistant up time, I can't be sure that it's not some trouble bit of code that runs only occasionally or if it's something that's a core part of the application. My current plan is to review the heap graph on the "sick" server and look for sudden jumps in memory usage then review the IIS logs for requests at those times to try and establish a pattern. If anyone has some better suggestions though, I'm all ears! The following are some facts about this situation that may be usefull.
    The "sick" server:
    - CF 9.0.1.274733 Standard
    - FusionReactor 4.0.9
    - Win2k8 Web R2 (IIS7.5)
    - Dual Xeon 2.8GHz CPUs
    - 4GB RAM
    JVM Config (same on "sick" and "good" servers):
    - Initial and Max heap: 1536
    -server -Xss10m -Dsun.io.useCanonCaches=false -XX:PermSize=192m  -XX:MaxPermSize=256m -XX:+UseParNewGC -Xincgc -Xbatch -Dcoldfusion.rootDir={application.home}/../ -Dcoldfusion.libPath={application.home}/../lib -Dcoldfusion.dotnet.disableautoconversion=true
    What I believe a "healthy" server graph should look like (from "good" server):
    And the "sick" server graph looks like this:

    @AmericanWebDesign, I would concur with BKBK (in his subsequent reply) that a more reasonable explanation for what you’re seeing (in the growth of heap) is something using and holding memory, which is not unusual for the shared variables scopes: session, application, and/or server. And the most common is sessions.
    If that’s enough to get you going, great. But I suspect most people need a little more info. If this matter were easy and straightforward, it could be solved in a tweet, but it’s not, so it can’t.
    Following are some more thoughts, addressing some of your concerns and hopefully pointing you in some new directions to find resolution. (I help people do it all the time, so the good news is that it can be done, and answers are out there for you.)
    Tracking Session Counts
    First, as for the observation we’re making about the potential impact of sessions, you may be inclined to say “but I don’t put that much in the session scope”. The real question to start with, though, is “how many sessions do you have”, especially when memory use is high like that (which may be different than how many you have right now). I’ve helped many people solve such problems when we found they had tens or hundreds of thousands of sessions.  How can you tell?
    a) Well, if you were on CF Enterprise, you could look at the Server Monitor. But since you’re not, you have a couple of choices.
    b) First, any CF shop could use a free tool called ServerStats, from Mark Lynch, which uses the undocumented servicefactory objects in CF to report a count of sessions, overall and per application, within an instance. Get it here: http://www.learnosity.com/techblog/index.cfm/2006/11/9/Hacking-CFMX--pulling-it-all-togeth er-serverStats . You just drop the files (within the zip) into a web-accessible directory and run the one CFM page to get the answer instantly.
    c) Since you mention using FusionReactor 4.0.9, here’s another option: those using FR 4 (or 4.5, a free update for you since you’re on FR 4) can use its available (but separately installed) FusionReactor Extensions for CF, a free plugin (for FR, at http://www.fusion-reactor.com/fr/plugins/frec.cfm). It causes FR to grab that session count (among many other really useful things about CF) to log it every 5 seconds, which can be amazingly helpful. And yes, FREC can grab that info whether one is on CF Standard or Enterprise.
    And let’s say you find you do have tens of thousands of sessions (or more). You may wonder, “how does that happen?“ The most common explanation is spiders and bots hitting your site (from legit or unexpected search engines and others). Some of these visit your site perhaps daily to gather up the content of all the pages of your site, crawling through every page. Each such page hit will create a new session. For more on why and how (and some mitigation), see:
    http://www.carehart.org/blog/client/index.cfm/2006/10/4/bots_and_spiders_and_poor_CF_perfo rmance
    About “high memory”
    All that said, I’d not necessarily conclude so readily that your “bad” memory graph is “bad”. It could just be “different”.
    Indeed, you say you plan to “look for sudden jumps in memory usage“, but if you look at your “bad” graph, it simply builds very slowly. I’d think this supports the notion that BKBK and I are asserting: that this is not some one request that “goes crazy” and uses lots of memory, but instead is the “death by a thousand cuts” as memory use builds slowly.  Even then, I’d not jump at a concern that “memory was high”.
    What really matters, when memory is “high” is whether you (or the JVM) can do a GC (garbage collection) to recover some (or perhaps much) of that “high, used memory”. Because it’s possible that while it “was” in use in the past (as the graph shows), it might no longer be “in use” at the moment . 
    Since you have FR, you can use its “System Metrics page” to do a GC, using the trash can in the top left corner of the top right-most memory graph. (Those with the CFSM can do a GC on its “Memory Usage Summary” page, and SeeFusion users can do it on its front page.)
    If you do a GC, and memory drops q lot, then you had memory that “had been” but no longer ”still was” in use, and so the high memory shown was not a problem. And the JVM can sometimes be lazy (because it’s busy) about getting to doing a GC, so this is not that unusual. (That said, I see you have added the Xincgc arg to your JVM. Do you realize that tells the JVM not to do incremental GCs? Do you really want that? I understand that people trade jvm args like baseball cards, trying to solve problems for each other, but I’d argue that’s not the place to start. In fact, rarely do I find myself that any new JVM args are needed to solve most problems.)
    (Speaking of which, why did you set the – xss value? And do you know if you were raising or lowering it form the default?)
    Are you really getting “outofmemory” errors?
    But certainly, if you do hit a problem where (as you say) you find requests hanging, etc., then you will want to get to the bottom of that. And if indeed you are getting “outofmemory” problems, you need to solve those. To confirm if that’s the case, you’ll really want to look at the CF logs (specifically the console or “out” logs). For more on finding those logs, as well as a general discussion of memory issues  (understanding/resolving them), see:
    http://www.carehart.org/blog/client/index.cfm/2010/11/3/when_memory_problems_arent_what_th ey_seem_part_1
    This is the first of a planned series of blog entries (which I’ve not yet finished) on memory issues which you may find additionally helpful.
    But I’ll note that you could have other explanations for “hanging requests” which may not necessarily be related to memory.
    Are you really getting “queued” requests?
    You also say that “the service will start to queue requests and eventually stop processing them all together”. I’m curious: do you really mean “queuing”, in the sense of watching something in CF that tells you that? You can find a count of queued requests, with tools like CFSTAT, jrun metrics, the CF Server Monitor, or again FREC. Are you seeing one of those? Or do you just mean that you find that requests no longer run?
    I address matters related to requests hanging and some ways to address them in another entries:
    http://www.carehart.org/blog/client/index.cfm/2010/10/15/Lies_damned_lies_and_CF_timeouts
    http://www.carehart.org/blog/client/index.cfm/2009/6/24/easier_thread_dumps
    Other server differences
    You presented us a discussion of two servers, but you’ve left us in the dark on potential differences between them. First, you showed the specs for the “sick” server, but not the “good” one. Should we assume perhaps you mean that they are identical, like you said the JVM.config is?
    Also, is there any difference in the pattern of traffic (and/or the sites themselves) on the two servers? If they differ, then that could be where the explanation lies. Perhaps the sites on one are more inclined to be visited often by search engine spiders and bots (if they sites are more popular or just have become well known to search engines). There are still other potential differences that could explain things, but these are all enough to hopefully get you started.
    I do hope that this is helpful. I know it’s a lot to take in. Again, if it was easier to understand and explain, there wouldn’t be so much confusion. I do realize that many don’t like to read long emails (let alone write them), which only exacerbates the problem. Since all I do each day is help people resolve such problems (as an independent consultant, more at carehart.org/consulting), I like to share this info when I can (and when I have time to elaborate like this), especially when I think it may help someone facing these (very common) challenges.
    Let us know if it helps or raises more questions. :-)
    /charlie

  • Memory leak when I use function with bstr_t type

    Hello,
    I use Visual C++ 6 and TestStand 3.1.
    I use the tool: Purify from Rational Instruments to detect memory leak in my code.
    When I use in my code, functions from the TestStand API using bstr_t types: GetValString, GetType... memory leaks appear.
    Do you have an idea to solve this problem?
    Thanks

    Breizh,
    Etes vous sur que le problèmes soit lié au type bstr_r ?
    Pouvez vous me faire parvenir un exemple de code mettant en oeuvre la fuite mémoire?
    Raphaël T.
    NI FRANCE
    Cordialement,
    Raphael T

  • Easy to produce - Memory Leak in JVM Using thread

    I was just debugging the problem with our server and got this error (not from the original code, I reproduced it with small code)
    at java.lang.Thread.run(Unknown Source)
    java.lang.OutOfMemoryError: unable to create new native thread
    at java.lang.Thread.start0(Native Method)
    at java.lang.Thread.start(Unknown Source)
    at SomeObject.resursiveThreadGeneratorMethod(ThreadRecursionLeak.java:12
    at ClientThread.run(ThreadRecursionLeak.java:27)
    it is just a simple program generating thread recursively with a lock on an object
    import java.lang.Runnable;
    import java.lang.Thread;
    //     <<Objec/Monitor Class>>
         class SomeObject{
              public synchronized void resursiveThreadGeneratorMethod(int threadNumber, int k){
                   if(k<=0)
                        return;
                   else{
                        System.out.println("Thread: "+threadNumber + "call number: "+k);
                        Thread thread=new Thread(new ClientThread(this));
                        thread.start();
                        resursiveThreadGeneratorMethod(threadNumber,k-1);
    //     <<Thread Class>>
         class ClientThread implements Runnable{
              SomeObject someObject=null;
              public static int threadNumber;
              public ClientThread(SomeObject someObject){
                   this.someObject=someObject;
                   threadNumber++;
              public void run(){
                   someObject.resursiveThreadGeneratorMethod(this.threadNumber,10);
    //     <<Driver Class>>
         public class ThreadRecursionLeak{
              public static void main(String [] args){
                   SomeObject someObject=new SomeObject();
                   Thread thread=new Thread(new ClientThread(someObject));
                   thread.start();
    is there any way I can monitor JVM memory status (programatically), kill those threads leading to memory leak and send notification to the system admin.
    We run JVM 1.4 on the server and need to address this issue as we do not have control over the code that can be submitted to the server, we just do some checks and then let it run on the servers.
    Our main requirement is to keep JVM alive and kill all those code and report them.
    Message was edited by:
    rajanikant_malviya

    You can monitor the JVM with the
    [url=http://java.sun.com/j2se/1.4.2/docs/guide/jvmpi/i
    ndex.html]JVMPI if you're using the Sun JVM.This is native code that basically gets
    notified anytime the JVM does something
    interesting.
    However, you're going to have a very difficult time
    catching code that does what the code you show does.
    I'm not sure I understand your environment - you
    allow people to submit code and you run it? Are you
    running it in the same JVM as your server? That
    seems like a huge issue. A simple System.exit()
    code will take down your server.
    Let us know some more details.
    We are actually having a portal through witch users can submit their code, witch are basically utility codes for different operations teams.
    we then provide a way to schedule them.
    At the background, we are having 6 (Win) servers where at each server we are having 20 to 25 users on different ports (managed by our application) running there own JVMs. When a schedule is met we just invoke a servlet (on any free port) and pass code id (stored in DB). And this servlet is responsible for compilation and exicution of the code (We just use Runtime to fork this new process).
    I don't know, but is there any way through witch I can monitor this process and restrict to generate threads recursively???

  • Firefox 4 still suffering from a serious memory leak, ends up using 2GB of RAM on 5 tabs and a few plugins?!!

    Why does even Firefox 4, which was supposed to have this issue fixed by now, still suffer from memory leaks?
    I opened up 4-5 tabs, enabled Firebug to tweak a few pages, and an hour later Firefox usage is up to 2GB of RAM?
    What a...?!
    Now, seriously, if you run to suggest that it is most likely due to add-ons and that I should disable them all and start Firefox in safe mode, let me just cut you off right there and ask you this - out of millions of people who downloaded this browser, who the hell uses it without any plugins and/or in safe mode?
    If you're gonna make a browser, make it so that it's lean and free of these issues to begin with, out of the box AND in case an addon or something else is added to it - can't they protect the core files and libraries from being victims to this, in case the addons are to blame?
    And in case it's a Firefox issue to start off with, seriously, can you get a dedicated developer to look into this alone and get it fixed, once and for all?

    I have six tabs open and generally have 3-5. It's been sitting here since last night. I'm using 296Mb ram which is high for me on Windows. My wife and son both use FF4 also and, having just checked, are between 210 and 268Mb respectively.
    No one I know ever complains about high memory usage in FF4 and neither have I experienced it since FF2.5 when memory leaks any user would notice were all fixed.
    So my advice is the same. If your add-ons aren't causing you problems, fix your system.

  • Finding Memory leaks in C using Visual Studio 2013

    I am using Visual Studio 2013, and taking a course in C programming and we started
    talking about memory bugs detaction, in particular memory leaks, and how to detect them using Valgrind on Linux.
    I want to know if there is a way to detect such memory leaks using VS 2013. I tried searching online but it just leads to lots of articles and blogs and msdn posts and blogs with lots of words like dump files, and analyzing them, etc which is weird
    because:
    1) It sounds so complex, convoluted and unintuitive it is actually hard to comprehend it.
    2) The main reason this is weird is due to the fact that VS is the most advanced IDE around and Microsoft spends so much money on in, yet from what I have read it seems that there is no simple way to use VS to detect memory leaks
    - certainly no way that's as simple as Valgrind where I only have to compile the program and run the command valgrind -leaks-check=yes ProgramName
    and it simply prints to me all location it thinks there is a memory leak and describes the error (like not freeing memory after allocating it with malloc hence having "dead" memory after the program finishes, or accessing memory that's out of
    the array bounds)                                                                                                                                                               
    So my question is how to use VS 2013 in order to achieve the same results and to find out First in high level if there are memory leaks in the program, and Second - to detect in a simple manner where those leaks are- preferably without involving dump files
    (not that I know how to use them anyway in VS).

    Hi MicrosoftLaw,
    Thanks for your post.
    Based on your issue, if you want to check if there are memory leaks in the C program from this VS2013. I suggest you could try to find Memory Leaks Using the CRT Library, for more information:
    https://msdn.microsoft.com/en-us/library/x98tx3cf.aspx?f=255&MSPPError=-2147217396
    In addition, I find a similar thread about this issue, please you refer the Dusty's suggestion to check this issue.
    http://stackoverflow.com/questions/45627/how-do-you-detect-avoid-memory-leaks-in-your-unmanaged-code
    I did some research about this issue, I found that the Visual Leak Detector extension tool is a free, robust, open-source memory leak detection system for Visual C++. So if possible, I suggest you could try to use the Visual Leak Detector extension
    tool to find the memory leak for Visual C/ C++ program.
    https://visualstudiogallery.msdn.microsoft.com/7c40a5d8-dd35-4019-a2af-cb1403f5939c
    However, if you have any issue about how to use this Visual Leak Detector extension tool to find the memory leak for C program. I suggest you could directly to write a review to this REVIEW tab in Visual Leak Detector site.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • With 10.2 I can only use system speaker output for audio, NOT my RME FF400 I used previously. The FF400 works fine with other apps. How can I set this device in FCP 10.2? (it is set in both system preferences and midi)

    With 10.2 I can only use a system (e.g. speaker) output for audio, NOT my RME FF400 I used without any problems previously. The FF400 works fine with other apps (some like TwistedWave) setup in the program, and others (like Spotify) using system preferences & audio midi setup. How can I set the FF400 to be the sound output device in FCP 10.2? N.B. The FF400 is set as sound output device in both system preferences and audio midi setup.

    From the fcp.co forum. See if this does anything for you.
    simon_hutchings
    OFFLINE
    Junior Boarder
    Posts: 24
    Thank you received: 5
    Karma: 1
    I have the solution! Well it at least worked for me. This is the response I got from Apple, Can you please try the following steps towards fixing your audio issue, and report back with your results?
    1. Open the application Audio Midi Setup (located in Applications : Utilities)
    2. Select the Output Tab for the current output device
    3. Select the Configure Speakers option
    4. Select the Multichannel tab
    5. Change the setting to Stereo Now mine was set to stereo but the left channel wasn't showing left. re-clicking on stereo reloaded the settings and after clicking apply it worked. 

  • How to use addKeyListener in a program running using command prompt

    Does anyone have any idea how to add the addKeyListener to a program running using command prompt.
    Let me explain how the program run.
    The program is start and accept call from other program. But from time to time, I need to issue some command by pressing the keyboard, let say, ESC is closed the program, F1 is showing the stated. F2.... (This is all need to run in the command prompt windows)
    My problem is this program does not have any gui interface, so how can it be added?
    i do it this way
    public void key(){          
    addKeyListener(this);
    But it have compile error.
    mainServerImpl.java:87: cannot resolve symbol
    symbol : method addKeyListener (mainServerImpl)
    location: class mainServerImpl
    addKeyListener(this);
    I did implement KeyListener. But just don't know how to solve this error.
    can anyone tell me how to solve it or point me a source that can help.
    Thank in advance!
    Regards,
    Tai Tan

    Write your own Thread, to do this:
    public class KeyThread extends Thread {
       public void run {
          while(true) {
             int i = System.in.read();
             if(i == 123) {
                break; // to stop the thread
    // in your main:
    Thread keyThread = new KeyThread();
    keyThread.start(); // calls run() of the thread

  • LV memory leak - How to use windows API SetProcessWorkingSetSize (from Kernel32.dll)

    Hi fellow LV'ers
    Okay - this is a bit tricky, but i'll try and explain the problem, then ask for the solution, because it may be that someone knows a better way to deal with this.. might get a bit long, sorry - if a solution comes up this will enable all of us to make more memory efficient LV code so please read on..
    Here is the deal:
    When building even a very simple LV executable, looking at the windows task manager will yield a rather large amount of memory allocated for such a small program - and the only way to free this up is by physically clicking the windows minimize button, then suddenly the amount drops to only a few MB and upon maximizing the window again the memory consumption will increase somewhat again, but for a simple VI build to an exe this move may change the consumption from +70MB to less than 15 MB.. This is irregardless of the code you put in the VI, so no coding example in this post as it is how LV works - you can even test it with the development environment - look at the task mgr and check LabVIEW's memory consumption, minimze ALL open NI windows incl project explorer etc, and you will see a significant decrease in memory usage even after maximizing again.. This has annoyed me since day one, but since RAM is a near zero cost these days it is not something I stay awake at night to think about.. However - I have moved into the "publish to web" tools now, wanting to do a remote monitoring part for my application for my customers to experience increased usability from the software i sell them..
    All is well, publishing is really easy (i use the monitor function, NOT the embeded, as customers need not have Labview RunTimeEngine installed, because they might look at it from a non RTE supported platform such as a mobilephone web browser)
    Everything is working fine also for the build application. However - I have noticed that once users start to remote monitor the running application - memory consumption of the running LV application starts to increase - and it keeps doing so - to such an extend that you can drain the computer complete and run off the cliff with a windows error... This is off course not very productive for me, being specialized in measurement applications that usually runs for a long period of time - I initially thought that I had done some poor programming in the VI used to display on the webpage - but it turns out that I can reproduce this behaviour with a simple boolean on an empty front panel..
    NI support has been informed, and they admit there is a problem, but so far solutions from them has been a bit too exotic for my taste, and thus I'm seeking the help of fellow LV programmers...
    You see - The method to solve the increasing memory consumption, is the exact same as mentioned above..minimize the application running with the "minimize" button and all memory will be freed, as soon as you maximize the application and users are viewing it remotely, the memory usage raises again, and history repeats... As previously mentioned, minimizing the window via normal LV calls to property nodes does not yield the same result, nor does a request deallocation of a VI(When you profile a project, there are no VI's increasing in memory, it is the LV process it self doing it) 
    After many many hours googling I stumbled upon this:
    http://support.microsoft.com/?kbid=293215
    I believe trimming the process with SetProcessWorkingSetSize would solve this problem, and now I would really like to be able to do this in my program, so that users are not forced to minimize the program every X hour depending on their system size...
    However - I have absolutely NO experience in calling windows API from LV, i need someone with that knowledge to provide an example of how to call this.. I've looked at examples on how to do calls to windows API - there is an example in this forum with some llb's in it, and I have gained a fair understanding of how parameters are passed between the calls, but none of those include the "hProcess" handle that is apparently needed for this specific winAPI call to work - Anyone in this forum with the knowledge on how to obtain this handle from a VI, if at all possible, and could provide an example VI for me to use - or even better , someone with the knowledge of how to do this within LV it self??
    Your help is much appreciated
    Best Regards
    Jacob
    LV8.6.1 patch something
    Win XP 
    Solved!
    Go to Solution.

    Hi Enrico
    Finally I can give something to the community that has given me so much  :-)
    The "official" statement is that "yes we know it is a problem".. Not sure what that will do to the future.. 
    I have the problem on 8.6.1 as well  - and in fact it is a general LV problem, that I first time reported to NI with LV8.2 as I was pissed by the fact that even the smallest exe file would consume + 50MB of memory until you manually minimized the window. Well - thanks to the feedback from Cosmin I seem to have solved the problem.
    I most warn that having started to "empty process" once in a while has led to occasional program crashes in the lethal "app.exe performed an illegal action and is closed" windows dialog - however what I did was to move the webserver to a seperate exe file and then communicate the data that I want to use via datasocket in a cluster.. It works like a charm and I simply stall the single thread that the webserver is running when ever the empty process is called and I have not seen a crash since then.. (the initial implementation was done in the main app with 4 parallel loops running, and I guess that was a disaster waiting to happen)
    Either way - what I have done is made a VI that at a user defined interval calls the empty process, simply by getting the .exe name from the task manager of the calling program - it is simple and very effective. I call it every 5 minutes - needless to say that flushing too often will most likely kill performance of the system. I have not noticed problems with VM - are you sure you are not storing large arrays or moving around copies of data not used frequently?
    For future reference to this forum, it is attached here including the .dll required to call - it is a LV8.6.1 file as I have not had the time to yet again test every single function of my program for new problems that could occur with upgrading to LV2009 
    I hope this solves your problem..
    best regards
    Jacob
    www.10EaZy.com 
    Attachments:
    EmptyProcess.zip ‏32 KB

  • Why do I get a memory leak when I use the Write Data Storage VI in a loop

    I have a large application that I am collecting various data points from. For the most part they are simple scalar values that need to be logged on a regular basis.  I was attempting to use the new TDM files and the storage VI's  I though everything was working until I looked at the taskmanager and noticed that when the logging loop ran my CPU eventually went to 100% and the process memory grew from about 80,000K to 100,000K and eventually locks up the system. 
    I am using a state machine arch. 
    State 1 - open file (open create) mode) 
    State 2 - Write Channel Group Properties
    State 3 - Loop writes 24 distinct data points to a TDM files in append mode
    State 3 - Repeats [creating new rows of the same 24 data point (wait time about 1 sec)]
    State 4 - Close file on exit.
    Any help on this problem would be appreciated.

    The way I see it, it should be this way.
    Message Edited by Pana-man on 09-30-2005 08:15 PM
    Message Edited by Pana-man on 09-30-2005 08:18 PM
    Paul <--Always Learning!!!
    sense and simplicity.
    Browse my sample VIs?
    Attachments:
    nextWeek.jpg ‏43 KB

  • Mail.app memory leak. RAM use increases until system is no longer usable

    I am having this problem since a week ago more less.
    Mail keeps increasing the memory use from a starting 100 Megas. Increasing something like 100 megas each 10 minutes, until the whole system is unresponsive.
    Any ideas?
    Thanks!
    PD: I have 3 IMAP accounts and 1 POP. In total 3348 messages. Running 10.5.4

    Thank for the fast reply!
    Indeed it happened to me. Whenever I dropped a file to the icon it would just hang up the computer. Then I removed my custom plugins (3 columns plugin, and Encryption plugin , I thing). And it worked well. Or at least I could drop files to the Mail Dock icon.
    My impression is that it might be related with IMAP and Gmail. I have 3 Gmail accounts. One of them is my primary email account, it has many many mail. The "all Mail" folder is a big one and probably Mail is trying to catch everything. It does so slowly in the background, creating the problem. May be. Just in case I selected the option not to download attachment in mails.
    Other suspect is the iGTD program I have been using. It syncs with Calendar and the ToDo folder in Mail. But the problem is still there even if iGTD is not working.
    I remember reading something about email with attachment that had numbers on the title, or something like that. It would create a similar problem but I can´t find it now.
    I have tried to control the output from "lsof | grep Mail" and "fs_usage -w -f filesys Mail" but I can´t find anything suspicius (not that I am an expert on that, though)
    THANKS a lot for the help.

  • Memory leak using GWT 1.4 and JDK 1.5

    We are running the following:
    OS : Solaris 5.10
    WebLogic version: 10.0
    JDK : Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_14-b03)
    Java HotSpot(TM) Server VM (build 1.5.0_14-b03, mixed mode)
    GWT : 1.4
    Oracle : 10g
    We have found memory leak with the above configuration.
    After running 1 session we are facing memory leak. The used Java heap is 4% higher than the one used after we conduct
    our memory tests for 1 user.
    Similarly, after running 5 concurrent sessions we are also facing memory leak where Java heap memory is utilised more
    by about 4%.
    I have used JRockit JDK 1.5 for figuring out memory leak. I have not found a memory leak in any of the modules
    developed by us.
    The memory leak issue is we think concerned with the version of JDK, Weblogic, Sun OS.
    Can somebody please suggest whether we can use the version as mentioned above?
    Any help on this front will be appreciated.

    gc log:
    #log information
    JAVA_OPTS="$JAVA_OPTS -verbose:gc "
    JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCDetails "
    JAVA_OPTS="$JAVA_OPTS -XX:+PrintGCTimeStamps "
    JAVA_OPTS="$JAVA_OPTS -XX:+DisableExplicitGC "
    JAVA_OPTS="$JAVA_OPTS -Xloggc:/path/to/gclog`date +%Y.%m.%d-%H:%M:%S`.log "Check sun papers for garbage collecting tips.
    >
    Is there any other way we can detect memory leak?
    >
    You have to profile your Application Server like you did with your own code.
    regards
    slowfly

  • Memory leak using 10.2.0.3 OCI client on Solaris

    Hi,
    We are using OCI client libraries to connect our C++ program to the Oracle Database. The program does a lot of selects, inserts and SP calls.
    Oracle client and Oracle server both are 10.2.0.3.
    We have been observing a memory leak of 4M bytes in the C++ program every few minutes since last few days. On debugging through Purify, libumem, and Sun Studio 12, we finally managed to narrow down the problem to the Oracle client library OCI calls.
    The Sun Studio leak check shows the following -
    Leak #37, Instances = 157, Bytes Leaked = 655004
    kpummapg + 0x00000098
    kghgex + 0x00000648
    kghfnd + 0x000005BC
    kghalo + 0x00000A6C
    kghgex + 0x000003BC
    kghfnd + 0x000005BC
    kghalo + 0x00000A6C
    kghgex + 0x000003BC
    kghfnd + 0x000005BC
    kghalo + 0x00000A6C
    kpuhhalo + 0x00000558
    kpugdesc + 0x00000AD4
    kpugparm + 0x00000374
    COCIResultSet::InterpretData() + 0x000001B4
    COCIResultSet::COCIResultSet(COCIStatement*,OCIStmt*,OCIError*) + 0x000000A4
    COCIStatement::PrepareResult() + 0x00000190
    A select is executed, a resultset is fetched and the resultset is immeidately closed. The same piece of code has been running at various production systems without any problems. Most of the other sites are either 10.2.0.4 or 9i.
    On searching Metalink and various other forums, I found similar issues faced in 10.2.0.1.
    Could someone advise if there are any bugs corresponding to this which have been closed. Would upgrading to 10.2.0.4 solve the problem?
    Thanks.

    Hi,
    Apparently a similar issue is being discussed over here:
    Re: Memory Leak
    Hope it helps.
    Regards,
    Naveed.

  • Memory leak using 10.2.0.3 OCCI client on Solaris 10

    Hi,
    We are using OCCI client libraries to connect our C++ program to the Oracle Database. The program does a lot of selects, inserts and SP calls.
    Oracle client and Oracle server both are 10.2.0.3 on Solaris 10.
    We have been observing a memory leak of 4M bytes in the C++ program every few minutes since last few days. On debugging through Purify, libumem, and Sun Studio 12, we finally managed to narrow down the problem to the Oracle client library OCI calls.
    The Sun Studio leak check shows the following -
    Leak #37, Instances = 157, Bytes Leaked = 655004
    kpummapg + 0x00000098
    kghgex + 0x00000648
    kghfnd + 0x000005BC
    kghalo + 0x00000A6C
    kghgex + 0x000003BC
    kghfnd + 0x000005BC
    kghalo + 0x00000A6C
    kghgex + 0x000003BC
    kghfnd + 0x000005BC
    kghalo + 0x00000A6C
    kpuhhalo + 0x00000558
    kpugdesc + 0x00000AD4
    kpugparm + 0x00000374
    COCIResultSet::InterpretData() + 0x000001B4
    COCIResultSet::COCIResultSet(COCIStatement*,OCIStmt*,OCIError*) + 0x000000A4
    COCIStatement::PrepareResult() + 0x00000190
    A select is executed, a resultset is fetched and the resultset is immeidately closed. The same piece of code has been running at various production systems without any problems. Most of the other sites are either 10.2.0.4 or 9i.
    On searching Metalink and various other forums, I found similar issues faced in 10.2.0.1.
    Could someone advise if there are any bugs corresponding to this which have been closed. Would upgrading to 10.2.0.4 solve the problem?
    Thanks.

    Please ... one post and one post only in the group most appropriate to your inquiry. Please open an SR at metalink.

Maybe you are looking for

  • Performance issue in Store Business Document functionality in ME52N

    Hi Guys, I have a problem in the Services for object in the transaction ME52N. In Services for object Create->Store Business document functionality when i try to drag&drop the PDF type file it is taking longer time. Please provide some input to impro

  • Video Playback Problem in Macbook Pro

    I'm facing problem playing any video in my Mac. Nomatter what player I'm using, after few second the video gets hanged for 1-2 second and then again resume but the audio is playing naturally. I don't know why this is ocuring but I really can't enjoy

  • A Question for Adobe

    I'm wondering if you guys could help us out by publishing a spread sheet of some sort which guide us to the exact targets and shooting sequence. This might be organized with inputs such as lens focal length(Or range), sensor size/geometry and outputs

  • Setting for E-TDS

    Hello Friends, I need your help on my below requirements: Request you to please sugest with solution: 1.     E TDS No. should come in e-TDS certificate 2.     Vendor PAN no. should also appear in e-TDS 3.     how to generate e-generation of xls file

  • Data from EKUN to BUT0ID

    Hi, We have upgraded to ECC 6 on ERP 2005. Earlier the business partner identification data was stored in EKUN table. But in ECC, it is supposed to be stored in table BUT0ID. Anyone knows about the standard report available to populate BUT0ID with da