Possible of memory leak in the loop

Recently my application do get OutOfMemory issue. I realized the memory is keep on stack up as i saw in the task manager, the jlaunch keep growing and it won't drop back. That day i'm running a search function and it will query the table to retrieve the data. The jlaunch shoot from 500MB -> 2.2GB and now remain in there. Wondering is it during it query it populate at least 10,000 records into the arraylist and then the memory already allocated and once i finish run the function, it will clear the allocated memory to re-use it.
public ArrayList ejbHomeInJDBCConnection(Map map){
     ArrayList beanList = new ArrayList();
     try{
          Context ctx = new InitialContext();
          DataSource ds = (DataSource) ctx.lookup("jdbc/POOL");
          Connection con = ds.getConnection();
          String query = "SELECT * FROM USER WHERE ";
          for (Iterator iterator = map.keySet().iterator(); iterator.hasNext();) {
               Object key = iterator.next();
               if(key.toString().startsWith("TIME") | key.toString().startsWith("TIMEIN")){
                    long longValue = Long.parseLong(map.get(key).toString());
                    query += key.toString()+ longValue + " AND ";      
               }else{
                    String value = (String)map.get(key);
                    query += key.toString()+ value + " AND ";      
          String newquery = query.substring(0, query.length()-5);
          newquery += " ORDER BY TIMEIN DESC";
          Statement stmt = con.createStatement();
          try {
               ResultSet rs = stmt.executeQuery(newquery);
              try {
                    while (rs.next()){
                         InBean bean = new InBean();
                         bean.setSmsId(rs.getString("EMP"));
                         beanList.add(bean);
               }finally{
                    rs.close();
          }finally{
               stmt.close();
     }catch(Exception e){
          System.err.println(e.fillInStackTrace());
return beanList;
Wondering is it the InBean will cause any memory leak as if there is 10,000 records, which mean it will create 10,000 objects and once it add into the arraylist the previous bean is not in use, will the GC clear it as i didn't set it as null. Do i need to do something like reallocate/defragment the memory?
Thanks.

Hi,
I'm sure a "count" would not generate the overhead you are concerned.
To understand some aspects, you need to read the source files of Java, and understand how the stack would work in your case.
Evertime you "add" an element to you list, the implementation will run the ensureCapacity, and grown the list one by one. Understand that the list is an Array with a lot more functions, but below, you are still working with an Array, and it needs to have a defined size. Everytime you add, it's doing a System.arraycopy(all the crap) - So you can save this, everytime you add something if you create your List with the right size.
Note, this is not an issue if we consider small lists, of small objects, but working with large lists, you can feel slow downs.
About the GC stuff, well.. I'm sure you can do some reading how it works. One good start point would be
Link: [http://java.sun.com/docs/hotspot/gc1.4.2/]
I'm sure you don't need that, but still, it's good reading. Maybe you should just increase your heap size, or you can manually clear the List using list.clear();
Rgds,
Daniel

Similar Messages

  • Is there any memory leaks in the version 4.6.21?

    Hi All:
    My en so weak ,so I try my best to let you understand my mean...
    I add replication to my app rencently.
    It's seem any memory leaks in the version 4.6.21.
    Threr is an env in my app's database. and there are 2000 dbs in the env. The 2000 dbs distributing In 200 directory . And the 200 directory is the subdirectory under the DATADIR.
    In the app, client and master create all subdirectory befoer the env been opened . And In my test ,if the master app use relative path to create Db and r/w data, the data will be correct send to client, The data in the master and client will keep identical.
    But, There is many memory leaks in the app.In my test ,the app will use up all memory that lead malloc failed and crash.
    the app use DB_LOG_AUTOREMOVE,DB_LOG_INMEMORY,DB_REPMGR_ACKS_NONE.
    cache_size = 500M.
    void event_callback(DbEnv* dbenv, u_int32_t which, void *info)
         bool * isMaster = (bool *)dbenv->get_app_private();
         info = NULL;                    /* Currently unused. */
         switch (which) {
         case DB_EVENT_REP_MASTER:
              *isMaster = 1;
              dbenv->errx("switch to master mode");
              break;
         case DB_EVENT_REP_CLIENT:
              *isMaster = 0;
              dbenv->errx("switch to slaver mode");
              break;
         case DB_EVENT_REP_STARTUPDONE: /* FALLTHROUGH */
         case DB_EVENT_REP_NEWMASTER:
         case DB_EVENT_REP_PERM_FAILED:
              // I don't care about this one, for now.
              break;
         default:
              dbenv->errx("ignoring event %d", which);
    Thanks
    d.j
    Message was edited by:
    user623248

    I setup logdir,datadir and envdir into different directories with
    the functions set_data_dir and set_log_dir.I created two directories
    under the datadir and created more than 100 sub-directories
    respectively for the two dir, where the 2000 databases located.By the way, even though it doesn't seem likely to be the cause of the
    memory leak, you should still fix this illegal usage of subdirectories
    before we get much further investigating. We might as well eliminate
    any possible source of problem, no matter how unlikely it seems.
    Also, just as an experiment, I would be very tempted to try running
    again without using any separate directories. In other words, don't
    call set_data_dir or set_log_dir at all, and just let everything be
    put into the one single directory. If that changes the results, that
    will be a big clue to help us know where to look for the problem.
    I'am writting a demo , but it take time.
    i will reply later .Thank you. Take your time -- we'll be here.
    Alan Bram
    Oracle

  • Memory leak on the native side

    Hello,
    I am hoping someone here can offer some troubleshooting advice, as I am completely stumped. I am running JBoss 5.1 with JDK 1.6_u18 (same problem with u17 and u16 too)
    - 32-bit, Linux (RHEL 5).
    - min/max heap setting of 1024M
    - permgen max of 256M
    - Thread stack size of 128K
    - No JNI
    My problem: The memory footprint of the JVM slowly grows until it hits the 3G OS limit. This takes about 8 hours under moderate load. At this time, it of course dies as it has no more addressable memory left.
    Here is the strange part: I have used every possible memory debugging tool (jmap, Eclipse MAT, etc) and nothing looks out of the ordinary in my Java heap. Thread count stays at a reasonable 350 threads, Java heap size stabilizes at about 500M. For the first hour or so, the JVM footprint stays at about 1.7G, which makes sense. After that it starts to slowly grow until in exceeds the 3G limit.
    What can I do to figure out where the leak is occurring? There is clearly some native resource that is being allocated but not freed. As I indicated, all the Java analysis tools report a healthy, stable heap and thread count.
    Thanks in advance.
    Jon

    Thanks for the reply.
    I have confirmed with -verbose:jni that the only JNI libraries getting loaded are those belonging to the JDK. My application does make heavy use of the ProcessClassLoader from the Jboss JBPM library, but classes all seem to be unloading normally, and my Permgen usage stays very low and stable. Is there anything I should look at in regards to this class loader? I have tried both a lack of GC parameters and specified the concurrent mark sweep collector, with the same results.

  • Memory leak in the JVM leading to system oom

    Hi,
    We are running application server using java 1.5, tomcat 5.5 ...
    The problem is that the JVM is allocating memory continuously.
    If we look at the JVM memory from JConsole everything is OK the amount of memory allocated in the heap does not grow significantly.
    If we look at the JVM memory consumption from the system perspective, the memory usage is growing until the system runs out of memory and kill the JVM. The JVM memory usage goes beyong 1.5 Go of memory whatever options you use when launching the JVM.
    The memory allocation is so intense that it can lead to a crash in few hours with very few users connected to the application.
    We have tried JDK 1.5.05 and 1.5.06 still the same.
    We are running on a Linux Debian system wth a 2.6.8 kernel.
    Any idea of where all this memory goes ?
    Any idea on how to track and solve this memory leak ?

    Hi Martinux,
    Tiger and Mustang come with a number of diagnosing tools that could help
    you spot memory problems. In particular there's something called 'jmap' which can
    take a snapshot of the JVM memory.
    Danny Coward has recently written a nice blog to emphasize the existence
    of this new tools - see
    "Crash Course: Java SE Monitoring, Management and Troubleshooting"
    http://blogs.sun.com/roller/page/dannycoward?entry=crash_course_java_se_monitoring
    Of course if the problem isn't in the JVM...
    BTW: you did also look at the non-heap memory, right? and also at the total
    number of loaded classes?
    hope this helps,
    -- daniel
    JMX, SNMP, Java, etc...
    http://blogs.sun.com/roller/page/jmxetc

  • Memory Leak with the new PatchMix App Beta?

    E6300/ASUS P5B-D/2GB RAM/EMU 0404/Vista Ultimate 32bit
    The problem happens after I upgrade to the PatchMix driver set dated 9/11.
    The physical memory usage bumps from ~24M to 150M after running 24 hours, and I didnt load any FX.
    The commit size(real memory usage) is over 500M!
    This doesnt happen with the old beta driver.
    Anyone has the same problem?

    Emon wrote:
    jreid wrote:
    Dare I suggest the problem might be Vista?
    Yes? How exactly would Vista cause a memory leak within PatchMix DSP's GUI?
    Well, just a thought. The OS is ultimately responsible for all memory management, and also the low-level graphics functions that would be called by e.g. the GUI code. I just noticed that people on XP didn't seem to be having the same problems with this beta.

  • Plugin-container.exe takes over and uses 100% of my CPU locking me out and leaving my PC non-functioning. Is this a bug, or a memory leak, in the Firefox software? Can anything be done to fix this problem?

    In looking at Windows Task Manager I found that plugin-container.exe was taking over 100% of my CPU and my system was frozen. Is this a memory leak or other bug?

    Thank you! I have been having problems with Adobe Flash since downloading the new 11.1 version. I will download it again and reinstall it, hopefully that will correct the problem.

  • Memory leaks in the app

    While doing memory leak profiling in an application, I came across leaks due to certain custom methods like readHeaderBytes or httpProtocolStart from CFNetwork, GSEventRunModal from GraphicsServices etc. What should I do to correct these memory leaks???

    Find the objects that you are allocating that aren't being freed and call release on them. Check out this link:
    http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt. html

  • Possible memory leaks in the code , ASSERT messages in debug version !!!

    Hi,
    I have my Indesign C++ plugin running successfully in DEBUG and RELEASE versions of Indesign.
    But in Debug version, when I close my Indesign, I get a series of ASSERTS which I am not able to figure out why.
    Below is the list of ASSERT I am getting while closing Indesign(loaded with my plugin)
    Still have un-registered listener
    ..\..\..\source\components\csxs\CSXSPlugPlug.cpp (562)
    ASSERT 'fInitialized' in ..\..\..\source\components\csxs\CSXSPlugPlug.cpp at line 1027 failed.
    ~InstanceList(): 2 outstanding references to UID 421 (Class kTextStoryBoss).
    ..\..\..\source\components\database3\main\InstanceList.cpp (1928)
    ~InstanceList(): 1 outstanding references to UID 443 (Class kSBOSMgrIndexStorageBoss).
    ..\..\..\source\components\database3\main\InstanceList.cpp (1928)
    ~InstanceList(): 1 outstanding references to UID 420 (Class kFrameListBoss).
    ..\..\..\source\components\database3\main\InstanceList.cpp (1928)
    ~InstanceList(): 5 outstanding references to UID 1 (Class ShuksanPrefix + 1 (0x101)).
    ..\..\..\source\components\database3\main\InstanceList.cpp (1928)
    28 Outstanding Bosses!(Check file :QA:Logs:OutstandingBossLog.txt)
    c:\development\citius\source\private\foundation\InterfaceTrackingUtils.cpp (107)
    What changes do I need to make in my code to avoid these ASSERTS and is this something I should worry about?

    I tried to follow the instructions by copying the text file and restarting Indesign but then it failed immidiately.
    I have use InterfacePtr every where to get the reference of the boss I dont understand how these Outstanding Boss classes are remaining in my code.

  • What needs to be released to avoid memory leaks in the jvm?

    I've got a C application server that makes Java calls to process requests.
    Eventually, the JVM runs out of memory, I assume because my C code is leaking references.
    My question is... what references should I be freeing? I am freeing local/global object references, but it still leaks memory.
    Should I also be freeing classIds? Method ids? Is DeleteLocalRef() the way to do that?
    Thanks,
    Jeff

    The simple answer is that you are responsible for deallocating every single reference (basically anything that isn't either a fieldID or a methodID) that is returned from a JNI call. The return value from each JNI call is a newly allocated local reference that you must delete with a call to DeleteLocalRef. For example, you must delete the jclass returned by FindClass() or the jthrowable returned by ExceptionOccurred(). In addition to that, you must also ensure that you delete any global references that you explicitly allocate yourself.
    Notice that the rules change, when you are executing from within the context of a native method invoked from the JVM. In that case, the JVM will automatically clean up any local references that are left over once the native method returns. Even then, though, it's smart to be careful with local references, because you can easily exceed the maximum number of local refs, or hold on to excessive amounts of objects, or hold onto objects for excessive amounts of time, because none of the local refs are deallocated by the VM until the native method actually returns.
    Local reference management is a real pain in the butt in JNI. For example, it took me quite some time to get it right in Jace.
    God bless,
    -Toby Reyelts
    Check out the free, open-source, JNI toolkit, Jace - http://jace.reyelts.com/jace

  • Memory leak/overload when looping by index over a large query and updating each DB record

    I am importing a CSV file into a temporary table and then running a select query that joins my actual database table with the temporary table, looking for any changes in the data. If changes exist, the select query is looped from 1 to #recordCount# and an update is applied to each record via cfquery. It runs very quickly (much more quickly than looping the query itself), but my memory spikes and overloads after about 1500 updates are completed. I need to be able to do upwards of 20000 at a time, without killing my system. I have tried manually setting the runtime garbage collection to trigger after X number of loops, but that doesn't seem to help. I am running CF8. See below for loop example:
    <cfloop from="1" to="#updatedRecordsQuery.recordCount#" index="a">
    <cftry>
                    <cfquery datasource="#db#" name="doUpdate">
                        UPDATE
                            CI
                        SET
                            firstname = <cfqueryparam cfsqltype="cf_sql_varchar" value="#updatedRecordsQuery.firstname[a]#" />,
                            lastname = <cfqueryparam cfsqltype="cf_sql_varchar" value="#updatedRecordsQuery.lastname[a]#" />,
                            etc, for about 15 various fields
                        FROM
                            client_info CI
                        WHERE
                            CI.client_id = <cfqueryparam cfsqltype="cf_sql_integer" value="#updatedRecordsQuery.client_id[a]#" />
                    </cfquery>
                    <cfcatch type="database">
                        <cfset local.updateErrorList = listappend(local.updateErrorList,updatedRecordsQuery.client_id[a]) />
                        <cfset local.error = true />
                    </cfcatch>
               </cftry>
    </cfloop>

    I would suggest to use select update instead of looping over query object and update each row one-by-one.
    Procedure:
    - Insert your CSV data into temp table.
    - Use a select update SQL query to update the changed data instead of looping over a select query.
    Example:
    UPDATE
       Table
    SET
       Table.col1 = other_table.col1,
       Table.col2 = other_table.col2
    FROM
       Table
    INNER JOIN
      other_table
    ON
       Table.id = other_table.id
    NOTE: You can put all your scripts in a Procedure.

  • Launching Mail becomes a runaway process and creates a massive memory leak in the kernel task

    I have 16gig of ram, my kernel task is currently using 12gig, Mail is no longer responding while using all remaining ram
    Mail has been jammed at 100% of one i7 core for about 2 hours now, disk activity is almost nonexistant.
    it was running poorly yesterday, rebuilding the mailboxes did not yeild a positive effect
    permissions and drive check out
    Quicklook is also reporting a lot of bs when finder windows are open:
    example:
    10/26/13 1:40:20.985 PM quicklookd[14056]: Warning: Cache image returned by the server has size range covering all valid image sizes. Binding: VariantBinding [0x603] flags: 0x8 binding: FileInfoBinding [0x503] - extension: mp3, UTI: public.mp3, fileType: ???? request size:32 scale: 1
    I hate the new activity monitor so much, none the less, "Memory Pressure" is pinned
    Seeing a whole lot of this in the console as well:
    10/26/13 2:57:11.000 AM kernel[0]: SMC::smcReadKeyAction ERROR TM6P kSMCBadArgumentError(0x89) fKeyHashTable=0x0xffffff802ba32000
    About to reset the SMC and NVRAM in hopes of a magical unicorn
    here is the profile output from EtreCheck:
    Hardware Information:
              MacBook Pro (17-inch, Early 2011)
              MacBook Pro - model: MacBookPro8,3
              1 2.3 GHz Intel Core i7 CPU: 4 cores
              16 GB RAM
    Video Information:
              Intel HD Graphics 3000 - VRAM: 512 MB
              AMD Radeon HD 6750M - VRAM: 1024 MB
    Audio Plug-ins:
              BluetoothAudioPlugIn: Version: 1.0
              AirPlay: Version: 1.9
              AppleAVBAudio: Version: 2.0.0
              iSightAudio: Version: 7.7.3
    Startup Items:
              M-Audio Firmware Loader - Path: /Library/StartupItems/M-Audio Firmware Loader
    System Software:
              OS X 10.9 (13A603) - Uptime: 2 days 22:34:21
    Disk Information:
              OWC     Mercury Pro RAID disk0 : (2 TB)
                        EFI (disk0s1) <not mounted>: 209.7 MB
                        JumboZero (disk0s2) /Volumes/JumboZero: 2 TB (25.5 GB free)
              WD      My Book         1105 disk6 : (4 TB)
                        EFI (disk6s1) <not mounted>: 209.7 MB
                        4TB Beast (disk6s2) /Volumes/4TB Beast: 4 TB (14.97 GB free)
              TOSHIBA MK7559GSXF disk2 : (750.16 GB)
                        EFI (disk2s1) <not mounted>: 209.7 MB
                        Flux (disk2s2) /: 749.3 GB (301.59 GB free)
                        Recovery HD (disk2s3) <not mounted>: 650 MB
              MATSHITADVD-R   UJ-898 
    USB Information:
              Apple Inc. FaceTime HD Camera (Built-in)
              Apple, Inc. Keyboard Hub
                        Logitech USB-PS/2 Optical Mouse
                        Apple, Inc Apple Keyboard
              Apple Inc. BRCM2070 Hub
                        Apple Inc. Bluetooth USB Host Controller
              Apple Inc. Apple Internal Keyboard / Trackpad
              Matrox DualHead2Go-DP
              Data Robotics Inc. Drobo 17.59 TB
                        EFI (disk5s1) <not mounted>: 209.7 MB
                        Drobo (disk5s2) /Volumes/Drobo 1: 17.59 TB (11.09 TB free)
              CPS OR2200LCDRM2U
              Apple Computer, Inc. IR Receiver
    FireWire Information:
              0x1F2 Vendor 0x1F2 Device 0x101800 400mbit - 400mbit max
              0x30E1 Oxford IDE Device 00 400mbit - 400mbit max
                        EFI (disk4s1) <not mounted>: 209.7 MB
                        Terabyte (disk4s2) /Volumes/Terabyte: 999.86 GB (13.63 GB free)
              Other World Computing Oxford ATA Device 00 800mbit - 800mbit max
                        EFI (disk3s1) <not mounted>: 209.7 MB
                        Payload (disk3s2) /Volumes/Payload: 2 TB (181.19 GB free)
    Thunderbolt Information:
              Apple Inc. thunderbolt_bus
    Kernel Extensions:
              com.Logitech.Control          Center.HID
              com.TrustedData.driver.VendorSpecificType00          (1.7.0)
              com.attotech.driver.ATTOiSCSI          (3.4.1b1)
              com.paceap.kext.pacesupport.snowleopard          (5.9)
              com.motu.driver.FireWireAudio          (1.6
    Problem System Launch Daemons:
              [failed] com.apple.AOSNotificationOSX.plist
              [failed] com.apple.installd.plist
              [failed] com.apple.softwareupdated.plist
              [failed] com.apple.wdhelper.plist
    Problem System Launch Agents:
    Launch Daemons:
              [loaded] com.adobe.fpsaud.plist
              [loaded] com.adobe.SwitchBoard.plist
              [loaded] com.attotech.iscsid.plist
              [loaded] com.datarobotics.ddservice64d.plist
              [loaded] com.klieme.TimeMachineScheduler.plist
              [loaded] com.novation.automap.pluginhelper.plist
              [loaded] com.paceap.eden.licensed.plist
              [loaded] org.macosforge.xquartz.privileged_startx.plist
              [loaded] PACESupport.plist
    Launch Agents:
              [not loaded] com.adobe.AAM.Updater-1.0.plist
              [loaded] com.adobe.CS5ServiceManager.plist
              [loaded] com.Logitech.Control Center.Daemon.plist
              [loaded] com.motu.MOTULauncher.plist
              [loaded] org.macosforge.xquartz.startx.plist
    User Launch Agents:
              [loaded] com.adobe.AAM.Updater-1.0.plist
              [loaded] com.adobe.ARM.[...].plist
              [failed] com.google.GoogleContactSyncAgent.plist
              [loaded] com.leadertech.PowerRegister.LGT2.c59807af95d106639fca8f10676ced62.plist
              [failed] com.logmein.rescue.sa.0372bc40-2c4a-4755-a5a8-ae3c68b59ab8.plist
              [failed] com.logmein.rescue.sa.2449ad28-4b5d-4836-b3d5-7adfb1c387c7.plist
              [loaded] com.valvesoftware.steamclean.plist
    User Login Items:
              CheatSheet
              Activity Monitor
              Clipboard History
              VMware Fusion Helper
              MagicMenu
              Dropbox
              Android File Transfer Agent
              Terminal
              Console
              Matrox PowerDesk
              Dictionary
              ShuttleHelper
              AutomapServer
              DDAssist
    3rd Party Preference Panes:
              Flash Player
              Flip4Mac WMV
              FUSE for OS X (OSXFUSE)
              Logitech Control Center
              M-Audio MIDISPORT 8x8
              TimeMachineScheduler
              Tuxera NTFS
    Internet Plug-ins:
              AdobePDFViewer.plugin
              AdobePDFViewerNPAPI.plugin
              Default Browser.plugin
              Flash Player.plugin
              FlashPlayer-10.6.plugin
              Flip4Mac WMV Plugin.plugin
              iPhotoPhotocast.plugin
              JavaAppletPlugin.plugin
              QuickTime Plugin.plugin
              RealPlayer Plugin.plugin
    User Internet Plug-ins:
    Bad Fonts:
              None
    Time Machine:
              Skip System Files: NO
              Mobile backups: OFF
              Auto backup: NO
              Volumes being backed up:
                        Payload: Disk size: 2 TB Disk used: 1.82 TB
                        Flux: Disk size: 749.3 GB Disk used: 447.7 GB
              Destinations:
                        Drobo [Local] (Last used)
                        Total size: 17.59 TB
                        Total number of backups: 2
                        Oldest backup: 2013-03-04 17:05:27 +0000
                        Last backup: 2013-10-22 13:23:41 +0000
                        Size of backup disk: Excellent
                                  Backup size 17.59 TB > (Disk size 2.75 TB X 3)
    Top Processes by CPU:
                 100%          com.apple.internetaccounts
                  10%          Activity Monitor
                   9%          Transmission
                   3%          WindowServer
                   3%          sysmond
                   1%          EtreCheck
                   1%          Dock
                   1%          Mail
                   0%          configd
                   0%          powerd
    Top Processes by Memory:
              2.43 GB            Mail
              426 MB             com.apple.internetaccounts
              115 MB             Finder
              98 MB              Transmission
              98 MB              CVMCompiler
              49 MB              Adium
              49 MB              mds_stores
              49 MB              WindowServer
              49 MB              Console
              33 MB              mds
    Virtual Memory Statistics:
              22 MB              Free RAM
              1.91 GB            Active RAM
              1.90 GB            Inactive RAM
              2.07 GB            Wired RAM
              9.39 GB            Page-ins
              416 MB             Page-outs

    I feel your pain!
    Mac Pro with 32 GB, and Mail takes about 5 minutes to "start" - well, show the Mail Menu. Then, another few minutes to actually draw the window... but wait, it STILL needs more time to actually show the accounts and mail.
    The (stupid) new Activity Monitor show Mail using 12 GB of RAM, and several com plist files also sucking up CPU time and RAM. Why Apple has to dumb-down good information to "Memory Pressure" is beyond me!
    I have reported thsi to Apple, and they had a Support person get in touch with me. I have sent several spindumps and tarball files last week, but no reply. Today, I pinged the support person who said Apple Engineering was reviewing the information, and would likely get back sometime as *maybe* some others were experiencing this problem...

  • Possible spotlight memory leak? CPU/python process taxes system 100%

    Posted this on other thread previously with no replies...and have read others with same problem, yet nobody with any solutions....this process almost always kicks in every other day only when my system is in sleep/standby mode which makes me think of spotlight (yet didnt think ANY process should be running in sleep mode). Also when no applications are open. (Except Activity Monitor - Which I set to be a startup item to find my slowdown since this problem has been bugging me for so long now)
    What it is, is "Python" process that is running taxes the system to 95-100% and wont stop until I force quit that process, then all is fine.
    I'm not sure how to look at the logs etc like some of you mention in the previous posts, but feel free to let me know how and I'll surely try to help where I can.
    I was wondering if upgrading to the new OS would fix the problem, or just compound it...perhaps have to do a clean install and wipe out all my files and aps to kill this one.. not sure how to find it...
    I even thought, <gasp> some form of virus, yet have used various virus scan tools only to have clean results... so hopefully this is not the case... so what processes use python (if not many) and how can I pinpoint this? The system is almost locked down while the python process is running so real difficult to do anything except kill the process.
    Help!
    Message was edited by: HBSteve

    And what should I be looking for in this log or what should the terminal command offer me if I do that as well... both I should try to do when this is happening?
    It's normally easiest to pick it out when you have Console open and observe when you try to reproduce the problem, but there are many Logs there for many things.
    familiar with cleaning up xp registries and startup processes... can I find something similar for mac?
    I think you should get Applejack...
    http://www.versiontracker.com/dyn/moreinfo/macosx/19596
    After installing, reboot holding down CMD+s, (+s), then when the DOS like prompt shows, type in...
    applejack AUTO
    Then let it do all 5 of it's things.
    At least it'll eliminate some questions if it doesn't fix it.
    The 5 things it does are...
    Correct any Disk problems.
    Repair Permissions.
    Clear out Cache Files.
    Repair/check several plist files.
    Dump the VM files for a fresh start.
    First reboot will be slower, sometimes 2 or 3 restarts will be required for full benefit... my guess is files relying upon other files relying upon other files!
    Disconnect the USB cable from any UPS so the system doesn't shut down in the middle of the process.

  • Does the 3dpc line plot have a memory leak? (ver 8.6.1)

    I have a very large application with a very small memory leak and the 3dpc line plot appears to be the most likely candidate.
    I create a line plot of data (100-200 points of XYZ) pass this to a Create 3dpc_surfaceplot:xctlcreate.vi in a loop (updated at a few hz).
    This code appears to grow in memory slowly over time (not at a regular pace sometimes a garbage collector must kick in).  Is this possible, is there anything I have to do to use this function in a loop, there is no help file provided for this vi.
    Can I avoide this situation (I am having trouble replicating te out of memory my client is seeing but again this is the most likely cause)?
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

    Hi Paul,
    Thank you for bring this to our attention. Do you have a small piece of code that exhibits this memory leak? If so, can you please it so that I can try to reproduce the issue here? If I can, then I can report the issue to R&D for further investigation.
    Aaron P
    National Instruments
    Applications Engineer
    http://www.ni.com/support

  • I am experiencing a memory leak when I write to a file in a loop.

    I am conducting a cycling test, each cycle represents about 48k of memory. I collect a selectable number of cycles into a shift register. When the chosen number of cycles is reached, I write the data to text files and then clear out the shift register. Unfortunately, I do not free up any memory space when this happens. I have been able to isolate the memory leak to the file writing function. I thought I was closing the reference when I closed the file, but apparently that is not happening. What space I free up by clearing the buffer, is cancelled by the memory required to make a reference to the file (I am guessing). This is all happening in a loop that must run as many as 500,000 times. Ideally, I
    would like to write as many as 1500 records at a time. At this point the memory leak makes this almost impossible. I have ordered some more memory, but I would rather plug the leak. I have read that LabView leaves a reference open to the file even after the file is closed. What can I do to clear the memory used up by leaving the reference open? Any insights would be very appreciated.

    The behaviour you describe is strange. Something to try: Open a refernce to the file one time before entering the loop, then inside the loop use that reference to do all the writing. Finally close the reference when the loop completes.If this doesn't work, post your code in 6.0 format and I'll be glad to look at it.Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Memory Leak when I get the SP return refcursor by oracle ODBC driver:

    Oracle server:&#65320;&#65328;&#65293;&#65333;&#65358;&#65353;&#65368;
    Oracle Version: 9.2.0.6.0
    Application Server: windows2003
    Develop tool &#65306; VC++;
    Question:
    when I get the return refcursor by OLEDB.Oracle, there is not any memory leak and work well. But when I change the driver to ODBC “Oralce in OraHome92"
    there will be an 56k memory leak.
    And in the other hand if I call an store precedure without return ref. Both driver /way can work well.
    Can you give me the advice? thanks a lot.
    Code such as:
    _ConnectionPtr m_AdoConnection;
    _CommandPtr pcmd = NULL;
    _RecordsetPtr sp_rs = NULL;
    _bstr_t bstrConstruct = _bstr_t("DSN=test;Uid=test;Pwd=test;PLSQLRSet=1");
    HRESULT hr = CoCreateInstance(__uuidof(Connection),NULL,CLSCTX_INPROC_SERVER,__uuidof(_ConnectionPtr),(LPVOID *)&m_AdoConnection);
    if (FAILED (hr) ) throw hr ;
    m_AdoConnection->PutCursorLocation(adUseClient) ;
    m_AdoConnection->IsolationLevel = adXactSerializable;
    m_AdoConnection->Mode = adModeShareExclusive;
    bstr_t bstrEmpty(L"") ;
    m_AdoConnection->Open (bstrConstruct, bstrEmpty, bstrEmpty, -1) ;
    SAFE_CALL(m_spObjectContext->CreateInstance(__uuidof(Command),__uuidof(_CommandPtr),(LPVOID *)&pcmd));
    if(pcmd == NULL)
    throw CAtlExceptionEx(E_POINTER,"pcmd is NULL");
    pcmd->CommandText = _bstr_t(L"wec_pkg_spl.wec_proc_spl_check");
    pcmd->CommandType = adCmdStoredProc;
    _bstr_t id = _bstr_t("65650000");     
    pcmd->Parameters->Append(pcmd->CreateParameter(_bstr_t(L"id"),DataTypeEnum(adVarChar),adParamInput,2000,_variant_t(id)));          
    pcmd->Parameters->Append(pcmd->CreateParameter(_bstr_t(L"errcode"),DataTypeEnum(adNumeric),adParamOutput,4));
    pcmd->Parameters->Append(pcmd->CreateParameter(_bstr_t(L"errdescription"),DataTypeEnum(adVarChar),adParamOutput,2000));
    pcmd->ActiveConnection = sp_con.m_AdoConnection;
    sp_rs = pcmd->Execute(NULL,NULL,adCmdStoredProc);
    pcmd->Release;          
    sp_rs->Close();     
    if (m_AdoConnection->State == adStateOpen)
    m_AdoConnection->Close();
    wec_pkg_spl.wec_proc_spl_check arguments:
    id          varchar2     in
    flowpaths     ref cursor     out
    errcode          number          out
    errdescription     varchar2     out
    Message was edited by:
    [email protected]

    I'm using the oracle ODBC driver 8.05.10 with MFC and client version 8.0.5. In my experience you can't prevent memory leaks with that or earlier versions of the ODBC driver. Client patchkits or service packs for NT or the Visual Studio doesn't solve the problem.
    The following code will result in a memory leak with the oracle driver. With every expiration of the timer the leak will grow.
    void CTestOdbcOracleDriverDlg::OnTimer(UINT nIDEvent)
    TCHAR errString[255];
    //open the database with class CDatabase
    //use of CRecordset
    TRY {
    //my table name is AL_ALARME_LOG
    pMyRecordset->Open(CRecordset::dynaset,"SELECT * FROM AL_ALARME_LOG",CRecordset::none);
    //do something with the data
    Sleep(0);
    pMyRecordset->Close();
    CATCH_ALL(error) {
    error->GetErrorMessage(errString,255);
    DELETE_EXCEPTION(error);
    END_CATCH_ALL
    CDialog::OnTimer(nIDEvent);
    The same code with the Microsoft ODBC driver
    doesn't cause memory leaks.
    Andreas ([email protected])

Maybe you are looking for

  • Iphoto 9.5.1 crash when i try to open photo

    Hi, Could anyone help me with iphoto , i hasnt used it recently but what i remember i opened some films imported from iphone , all worked fine. Now when i try to open photo , film it crashes.I've tried repairing permissions, repairing the database, r

  • Converting logo from CMYK to PMS SPOT

    Hello everybody was wondering if you could lend a hand. I have a logo that i wish to conver to pms spot colour as that is what the artwork requirement is, it is currently in CMYK. I am currently using cs5. Edit, Edit Colours,Recolour artwork,  then i

  • Security for Business Rules on Planning Menus

    We recently upgraded to 11.1.2.3.500. Planning is patched to 11.1.2.3.501. We have right-click menus that are used on our data forms to launch business rules. We are finding that users without access to the business rules are able to see the rules on

  • Selection to covp table is slow

    hi guys, i am doing a selection to table covp, its a view table .. how can i tune up the selection process SELECT * INTO CORRESPONDING FIELDS OF TABLE tcovp BYPASSING BUFFER                        FROM covp                        FOR ALL ENTRIES IN i

  • Logical volume activation during bootup shows "Maps lock" errors

    this started happening sometime after the creation of two lvm snapshots (including 1 root volume snapshot which, as i have since read, may be an issue) but this has never happened to me before in conjunction with snapshotting.  the following outputs