Inactive RAM - Not Returning to Free

I have come to notice that after launching somewhat memory hungry programs, such as HandBrake (a DVD ripping application), the RAM is slowly activated until there is at least 1 GB Inactive RAM, even though actual active and wired RAM is 1/2 GB at most.
Though this is to be expected, it seems that RAM continues to move to Inactive until there is only 50 MB of Free RAM left, even though no more RAM is being used for the actually application.
You would think this wouldn't cause a difference in performance, but all streaming video moves with short blips every half second, and in general the computer begins to lag.
Yet after I terminate the application, none of the RAM is restored to the Free state, and the lag continues, suggesting that the computer is digging to the actual Hard Drive for memory.
Does anyone know what is going on, or any pointers on how to avoid this?

Hi,
There are some changes to memory garbage collection introduced with Leopard. Of course, there is supposed to be improvement. Here's an article I found:
http://developer.apple.com/leopard/overview/objectivec2.html
It could be an older application might not be optimized for best garbage collection strategy, and the default under Leopard might not be as efficient. A tweak and recompile might be needed to specify the best suited garbage collection alogorithm. This is the kind of thing that probably wouldn't show unless an application allocates and deallocates a lot of memory. It sounds like Leopard holds off rebuilding its free list as long as possible, so there's more work for it to do and hence a video stutter.
I think for something like VLC, the generational garbage collection strategy may get in the way because moderate chunks of memory are getting allocated at a constant rate as rendering takes place. The garbage collector thread of a Cocoa application runs at low priority and the way allocations are taking place make more work when the collection thread has to examine the object graph for long-lived objects to free. I'm not a heavy duty kernel and Cocoa person; please forgive me if I am in error.
The upshot is that Leopard may be the cause, but not because Leopard is doing something wrong per se.
Bill

Similar Messages

  • Inactive RAM not reclaimed?

    Hi,
    I recently got my 27'' iMac. Today I had a lot of apps opened and noticed something really weird: My iMac became really sluggish even though the apps weren't that CPU intensive and CPU wasn't used that much. I then noticed my system memory readings seemed kind of odd:
    Free: 40MB
    Wired: 480MB
    Active: 2.3GB
    Inactive: 1.14GB
    Swap Used: 1.73GB
    I think the computer became sluggish because the RAM was full. But what I really wonder about: Why does mac os start swapping RAM to the hard drive when there is 1.1GB of inactive RAM? Shouldn't the OS reclaim that RAM first which would be much faster than swapping all the time? It was kind of annoying since I was watching an HD movie and it lagged even though CPU usage was low and there was 1.1GB of inactive, fast RAM the system could have claimed.
    Ideas on this?
    thanks

    Yes.
    That "works"...but it isn't really annoying, and even somehow, is that not "the way" to solve it?
    - I think -
    Since I have 4Gb. RAM, a new updated MBP (using basic aps - mail, ical, safari, address-book, itunes,finder,ms.office, adium and skype, - and I do not use PS, FC or VM's) - it doesn't make much sense (to me) to realize (and I do) that I need to upgrade to 8Gb. in order to have a proper and smooth performance (that it should already be), just because the system 'eats' literally the ram installed.
    And of course, since the RAM upgrade is not what it could be called "cheap", and not a solution - I can't afford it right now at that prices - I can't keep searching and trying to find a workaround to solve this...
    I simply can not understand how I do have page ins/outs and swap use, considering that the inactive memory (usually more than 1Gb. ) is still there, and it's noticeable when the system - sluggish - has to access the hard disk.
    And how after a day, 2 or more...the system starts to become fatter.
    Because it does.
    And how, anyone seems to bother, ask, and complain about it.
    Well, some people did, but mostly the answers to them are mainly that the system is ok, nothing's wrong, and just upgrade or permissions repair.¿?
    Well I'm may be, a "demanding" user, but my expectations are according to my light-user-tasks and the machine used and its expected performance...or may be I have to start restarting my system every day to avoid it. (or do the permissions repair)
    And that there is not response, neither solution still 10.6.4.
    It's like no one seems to see it.
    Just a few. And most users tend to think that there's nothing wrong about it.
    But I do not get it.
    Meanwhile, the only thing I can do is, pray for that one of these to things happens: either next 10.6.x update fix it, or RAM prices decreases... but I can't see other options right now.
    (Thanks, and excuse my english)
    Message was edited by: pereze

  • Inactive RAM not being used/freed

    As I type this, my other computer has 590mb of inactive RAM, with 2mb of page outs and 11mb of page ins. Shouldn't the almost 600mb of inactive ram I have start being used instead of page swapping so much?

    About OS X Memory Management and Usage
    Reading system memory usage in Activity Monitor
    Memory Management in Mac OS X
    Performance Guidelines- Memory Management in Mac OS X
    A detailed look at memory usage in OS X
    Understanding top output in the Terminal
    The amount of available RAM for applications is the sum of Free RAM and Inactive RAM. This will change as applications are opened and closed or change from active to inactive status. The Swap figure represents an estimate of the total amount of swap space required for VM if used, but does not necessarily indicate the actual size of the existing swap file. If you are really in need of more RAM that would be indicated by how frequently the system uses VM. If you open the Terminal and run the top command at the prompt you will find information reported on Pageins () and Pageouts (). Pageouts () is the important figure. If the value in the parentheses is 0 (zero) then OS X is not making instantaneous use of VM which means you have adequate physical RAM for the system with the applications you have loaded. If the figure in parentheses is running positive and your hard drive is constantly being used (thrashing) then you need more physical RAM.
    Adding RAM only makes it possible to run more programs concurrently.  It doesn't speed up the computer nor make games run faster.  What it can do is prevent the system from having to use disk-based VM when it runs out of RAM because you are trying to run too many applications concurrently or using applications that are extremely RAM dependent.  It will improve the performance of applications that run mostly in RAM or when loading programs.

  • Free ram to Inactive Ram

    I'm not really sure how to ask this, but here goes. I know that inactive ram is better than free ram, inactive ram actually helps speed up my computer. And I know that free ram isn't really being used by the computer. I see that I usually have anywhere from 80 to 120 mb of free ram. I guess the question, how can I get that free ram to become inactive ram so that my laptop is at full potential? Thanks guys.

    Free RAM hasn't been used by any process recently, while inactive RAM has been used by a process and is being preserved in case the application which previously used it needs it again. You can use up the free RAM by opening additional applications, but if you don't intend to do anything else in those applications, you will not get any speed benefits by doing this.
    (14052)

  • Too Much Inactive RAM, Too Little Free RAM

    I used to have a 2007 iMac running Snow Leopard, and I switched to a 2011 iMac running Mountain Lion. On both of my computers, I kept running out of free RAM after a while, and my inactive RAM kept taking up all my free RAM. It still does it. I end up with around 30MB of free RAM, a reasonable amount of active RAM, and a massive amount of inactive RAM after a few days, then my computer slows down a lot.
    I have to keep flushing the inactive RAM with a memory cleaning tool or else my computer slows to a crawl. Repairing the permissions is supposed to clean out the inactive RAM (thanks, Tuttle), but alarmingly, this doesn't work for me. There must be something causing this problem, and I want to find it. How do I do this? Can processes currently running be using inactive RAM, or is that only possible if they have just been closed? Is there a tool that can check how much inactive RAM is allocated to each process?
    P.S. To make it clear: I know that I'm not supposed to worry about inactive RAM and let the system do its own optimization, but it must not be doing it right because it's causing extremely noticeable slowdowns. The computer is like a Geo Metro pulling a whale if I don't flush the inactive RAM periodically.

    Since you are so concerned, take your iMac to your local AS or an AASP for a FREE diagnostic test.  At least you will have piece of mind when you get a confirmation of what is really going on.

  • 16 Gig of total RAM - Only 1 GIg Free but  11 Gigs Inactive

    What does this mean??? Is the 11 Gigs locked by applications. Do I need to free this memory?

    It means you need to take a quick course in OS X memory management:
    About OS X Memory Management and Usage
    Reading system memory usage in Activity Monitor
    Memory Management in Mac OS X
    Performance Guidelines- Memory Management in Mac OS X
    A detailed look at memory usage in OS X
    Understanding top output in the Terminal
    The amount of available RAM for applications is the sum of Free RAM and Inactive RAM. This will change as applications are opened and closed or change from active to inactive status. The Swap figure represents an estimate of the total amount of swap space required for VM if used, but does not necessarily indicate the actual size of the existing swap file. If you are really in need of more RAM that would be indicated by how frequently the system uses VM. If you open the Terminal and run the top command at the prompt you will find information reported on Pageins () and Pageouts (). Pageouts () is the important figure. If the value in the parentheses is 0 (zero) then OS X is not making instantaneous use of VM which means you have adequate physical RAM for the system with the applications you have loaded. If the figure in parentheses is running positive and your hard drive is constantly being used (thrashing) then you need more physical RAM.

  • Inactive ram

    i just got a new intel imac 27" with 4gb of ram. My problem is that i have anywhere from 1gb to 1.6gb of ram that is inactive. What can i do to correct this and make it free? I cant find the processes in activity monitor either to quit them.

    Inactive RAM usage is not a problem; it is a normal & beneficial consequence of the advanced memory management system of OS X.
    Inactive memory contains items that may be used again soon & are thus temporarily retained in memory to avoid the extra time it takes to fetch them from the hard drive all over again. If these items were released from inactive memory prematurely, the performance of your iMac would suffer. To avoid this, the memory management system constantly monitors what is in inactive memory & tries to release parts of it to the free memory pool only a when it becomes obvious its contents will not be reused again soon, for instance when you quit a process. However, since inactive memory contains items shared by several processes, quitting one process does not generally release all its inactive memory.
    Another way to look at this is free memory is memory unused by any process, active or inactive, & thus there is no benefit to having large amounts of it doing nothing.

  • Too much inactive RAM + EtreCheck results

    Hi, I noticed that my macbook pro is getting slower and slower, even though I close applications that are not being used.
    Right now my RAM is the following, with only two applications open, chrome and email.
    Out of 8Gb RAM laptop:
    Wired: 1.17Gb
    Active 1.8Gb
    Inactive 4.62Gb
    Free 409Mb
    Etrecheck report:
    EtreCheck version: 2.1.8 (121)
    Report generated 19 March 2015 12:58:07 PM AEDT
    Download EtreCheck from http://etresoft.com/etrecheck
    Click the [Click for support] links for help with non-Apple products.
    Click the [Click for details] links for more information about that line.
    Hardware Information: ℹ️
        MacBook Pro (13-inch, Late 2011) (Technical Specifications)
        MacBook Pro - model: MacBookPro8,1
        1 2.8 GHz Intel Core i7 CPU: 2-core
        8 GB RAM
            BANK 0/DIMM0
                4 GB DDR3 1333 MHz ok
            BANK 1/DIMM0
                4 GB DDR3 1333 MHz ok
        Bluetooth: Old - Handoff/Airdrop2 not supported
        Wireless:  en1: 802.11 a/b/g/n
        Battery Health: Normal - Cycle count 775
    Video Information: ℹ️
        Intel HD Graphics 3000 - VRAM: 512 MB
            Color LCD 1280 x 800
    System Software: ℹ️
        Mac OS X 10.7.5 (11G63) - Time since boot: 1:44:36
    Disk Information: ℹ️
        APPLE HDD HTS547575A9E384 disk0 : (750.16 GB)
            disk0s1 (disk0s1) <not mounted> : 210 MB
            Macintosh HD (disk0s2) / : 749.30 GB (101.31 GB free)
            Recovery HD (disk0s3) <not mounted>  [Recovery]: 650 MB
        MATSHITADVD-R   UJ-8A8
    USB Information: ℹ️
        Apple Inc. BRCM2070 Hub
            Apple Inc. Bluetooth USB Host Controller
        Apple Inc. Apple Internal Keyboard / Trackpad
        Apple Inc. FaceTime HD Camera (Built-in)
        Apple Computer, Inc. IR Receiver
    Thunderbolt Information: ℹ️
        Apple, Inc. MacBook Pro
    Configuration files: ℹ️
        /etc/hosts - Count: 1
    Kernel Extensions: ℹ️
            /System/Library/Extensions
        [loaded]    com.Cycling74.driver.Soundflower (1.5.2) [Click for support]
        [not loaded]    com.LaCie.driver.PXHCD (1.0.11 - SDK 10.6) [Click for support]
        [not loaded]    com.ZTE.driver.ZTEUSBCDCACMData (1.3.12) [Click for support]
        [not loaded]    com.ZTE.driver.ZTEUSBMassStorageFilter (1.3.12) [Click for support]
        [not loaded]    com.devguru.driver.SamsungComposite (1.4.18 - SDK 10.6) [Click for support]
        [not loaded]    com.sierrawireless.driver.SierraDIPSupport (1.0.0) [Click for support]
        [not loaded]    com.sierrawireless.driver.SierraFSRSupport (3.0.0) [Click for support]
        [not loaded]    com.sierrawireless.driver.SierraHSRSupport (3.0.0) [Click for support]
        [not loaded]    com.sierrawireless.driver.SierraIPDirect (1.1.5) [Click for support]
            /System/Library/Extensions/ssuddrv.kext/Contents/PlugIns
        [not loaded]    com.devguru.driver.SamsungACMControl (1.4.18 - SDK 10.6) [Click for support]
        [not loaded]    com.devguru.driver.SamsungACMData (1.4.18 - SDK 10.6) [Click for support]
        [not loaded]    com.devguru.driver.SamsungMTP (1.4.18 - SDK 10.5) [Click for support]
        [not loaded]    com.devguru.driver.SamsungSerial (1.4.18 - SDK 10.6) [Click for support]
    Launch Agents: ℹ️
        [not loaded]    com.adobe.AAM.Updater-1.0.plist [Click for support]
        [loaded]    com.adobe.CS4ServiceManager.plist [Click for support]
        [running]    com.bjango.istatmenusagent.plist [Click for support]
        [loaded]    com.google.keystone.agent.plist [Click for support]
        [unknown]    com.oracle.java.Java-Updater.plist [Click for support]
        [running]    com.sierrawireless.SwitchTool.plist [Click for support]
    Launch Daemons: ℹ️
        [loaded]    com.adobe.fpsaud.plist [Click for support]
        [loaded]    com.adobe.SwitchBoard.plist [Click for support]
        [running]    com.bjango.istatmenusdaemon.plist [Click for support]
        [loaded]    com.google.keystone.daemon.plist [Click for support]
        [unknown]    com.oracle.java.Helper-Tool.plist [Click for support]
    User Launch Agents: ℹ️
        [loaded]    com.adobe.ARM.[...].plist [Click for support]
        [loaded]    com.facebook.videochat.[redacted].plist [Click for support]
        [loaded]    com.google.GoogleContactSyncAgent.plist [Click for support]
        [failed]    com.wondershare.mobilegodaemon.plist [Click for support] [Click for details]
    User Login Items: ℹ️
        iTunesHelper    Application  (/Applications/iTunes.app/Contents/MacOS/iTunesHelper.app)
    Internet Plug-ins: ℹ️
        JavaAppletPlugin: Version: 14.9.0 - SDK 10.7 Check version
        o1dbrowserplugin: Version: 5.40.2.0 - SDK 10.8 [Click for support]
        Unity Web Player: Version: UnityPlayer version 5.0.0f4 - SDK 10.6 [Click for support]
        Flip4Mac WMV Plugin: Version: 2.4.2.4 [Click for support]
        AdobePDFViewerNPAPI: Version: 11.0.10 - SDK 10.6 [Click for support]
        FlashPlayer-10.6: Version: 16.0.0.305 - SDK 10.6 [Click for support]
        Silverlight: Version: 4.0.60531.0 [Click for support]
        QuickTime Plugin: Version: 7.7.1
        Flash Player: Version: 16.0.0.305 - SDK 10.6 Outdated! Update
        googletalkbrowserplugin: Version: 5.40.2.0 - SDK 10.8 [Click for support]
        AdobePDFViewer: Version: 11.0.10 - SDK 10.6 [Click for support]
        DirectorShockwave: Version: 12.0.7r148 - SDK 10.6 [Click for support]
    User internet Plug-ins: ℹ️
        npNASAEyes: Version: Unknown
        Google Earth Web Plug-in: Version: 7.1 [Click for support]
    Audio Plug-ins: ℹ️
        DVCPROHDAudio: Version: 1.3.2
    3rd Party Preference Panes: ℹ️
        Flash Player  [Click for support]
        Flip4Mac WMV  [Click for support]
        Perian  [Click for support]
        Tuxera NTFS  [Click for support]
    Time Machine: ℹ️
        Time Machine not configured!
    Top Processes by CPU: ℹ️
             7%    Google Chrome
             4%    WindowServer
             1%    hidd
             0%    SystemUIServer
             0%    AppleSpell
    Top Processes by Memory: ℹ️
        215 MB    Google Chrome Helper
        172 MB    Google Chrome
        120 MB    Mail
        94 MB    SystemUIServer
        94 MB    Finder
    Virtual Memory Information: ℹ️
        63 MB    Free RAM
        2.17 GB    Active RAM
        5.04 GB    Inactive RAM
        1.31 GB    Wired RAM
        1.17 GB    Page-ins
        14 MB    Page-outs
    Diagnostics Information: ℹ️
        Mar 19, 2015, 11:12:02 AM    Self test - passed
        Mar 17, 2015, 01:32:57 PM    /Library/Logs/DiagnosticReports/Kernel_2015-03-17-133257_[redacted].panic [Click for details]

    None of the usual problems are present.
    Activity Monitor – Monitor Performance Problems  
    Performance Guide
    Why is my computer slow
    Why your Mac runs slower than it should
    Things you can do to resolve slowdowns  see post by Kappy

  • Inactive RAM (yes I know what it does)

    My question is how Inactive RAM is reported once it has been used by the system. Here is what is happening to me. I sometimes there will be a spike in my RAM used and when I look at the activity I will see that there is about 200-250mb of Inactive RAM but my computer will slow to a crawl like it is out of RAM. I understand Inactive RAM is not currently being used and is supposed to be released when needed by other programs but when it is released should it shift to Active RAM? So should I see my Inactive RAM go down and my Active RAM go up? Or does the Inactive RAM just stay the same even though it is being used by the system.

    The following may not directly answer your question, but it should help you better understand how memory management works in OS X.
    About OS X Memory Management and Usage
    Reading system memory usage in Activity Monitor
    Memory Management in Mac OS X
    Performance Guidelines- Memory Management in Mac OS X
    A detailed look at memory usage in OS X
    Understanding top output in the Terminal
    The amount of available RAM for applications is the sum of Free RAM and Inactive RAM. This will change as applications are opened and closed or change from active to inactive status. The Swap figure represents an estimate of the total amount of swap space required for VM if used, but does not necessarily indicate the actual size of the existing swap file. If you are really in need of more RAM that would be indicated by how frequently the system uses VM. If you open the Terminal and run the top command at the prompt you will find information reported on Pageins () and Pageouts (). Pageouts () is the important figure. If the value in the parentheses is 0 (zero) then OS X is not making instantaneous use of VM which means you have adequate physical RAM for the system with the applications you have loaded. If the figure in parentheses is running positive and your hard drive is constantly being used (thrashing) then you need more physical RAM.

  • How do I prevent inactive ram

    I've discovery through Activity Monitor that all my ram is inactive whenever I awake from sleep.  Running apps are safari, itunes, CS6 and Bridge.  There's 32GB ram so that a lot for these apps.  How can I prevent this? 
    Below are screen shots before and after purge command.

    Inactive RAM is not a disease. It is made up mostly of Disk data read by the system, which is being preserved momentarily in case you need it. (why waste it, if it has already been read.)
    It is instantly turned into Free RAM when the System needs more.
    Much more important for performance is PageOuts and Swap used. Both of these numbers on your graphs are extremely modest.
    You are fine. Live long and prosper.
    Using Activity Monitor to read System Memory and determine how much RAM is being used

  • Sales returns with free goods

    Hi All,
    We are trying create sales returns with Invoice. But system is not copying the free goods item. I have checked relevant item category determination and Copy controls, everything is looking fine for me.
    Please let know if any other settings are required.
    I am getting below meeage.
    Item category for item 000021 cannot be determined
    Item 000021 is not copied from the refer
    document.
    Thanks.

    Hi radha
    Say you have created a creditmemo with G2 document type and you are getting a item category of G2N , so check the item category TANN is available or not with G2 doctype and item category G2N  in VOV4 .Check in copy control wheather the item category is available or not in VTLA  . I suppose it is not there that is the reason you were getting error.
    Maintain item category data at copy control VTLA then your problem will be solved
    Regards
    Srinath

  • Returns and Free Item indicator in Purchase Requsition

    Can we get the FREE Item and Returns Item indicator (as available in PO) in Purchase requsition.
    Can we create returns PR or free item PR.
    Thanks,

    PR is an internal document. You do not need a FREE indicater at that level

  • Apple Care will not return my Hard drive.

    I have a Power Book G4 1.67 . The hard drive has failed, it is covered under applecare for another 6 months, I have case number, the person on the phone was very nice, they sent the shipping box.
    I think it's more then just the HD, however. The drive was partitioned in 3 sectors. Of course the system sector was the one that failed. I can boot in Target Disk Mode and see the other 2 sectors of the drive. The system sector is the one that is bad, I can't get that info off there. I am sure someone else can who is better qualified can. I really need that info, I can see they system partition in Disk Warrior, but am not a guru in that or the couple of other products I bought to see if I could rescue this info.
    I asked AC Rep if I could have the Hard Drive back, they said no, I asked if they would back up the information, they said no, I said I would pay for either back up or pay for the old hard drive myself, (again) they said no.
    So now I am stuck, if I replace that HD myself, I may void the warranty, I know it's a customer installable part. I have replaced many over my apple years, upgrading HDs about every 2 years in multiple computers and putting the old ones in external cases. I have also upgraded RAM, airport cards, pram batteries so I am comfortable working the simple upgrades. So I could simply replace that Hard Drive and then send it in, but then they may blame me for the problem.
    There also smaller problems, screen latch won't stay closed, superdrive will not eject correctly, screen has some lines in it occasionally. It's not a road warrior, but I use it a lot and always treat these well. The drive was making no noise at all and no indication of a impeding failure. I treat my machines very carefully, I still have a Pismo that is gasping it's last breath.
    This HD has all my important passwords and other personal info, I was in the middle of backing it up when thing went blitz. I saved the data from the other 2 partitions but I need that HD. Why will they not return my old part ? Or even back it up for a fee. I am afraid to replace the HD with a new one, and then send it off, or even try to reboot it from a new one as I maybe be stuck with it and they say well I did the damage.
    Yes I know multiple back ups, but this is the first HD failure in 20 years and I should have had 2 HDs for back ups instead of one. Any other part I could see their point, but that HD has information I need and I don't want someone having it either. Is there a fair solution here.
    This thing has been down a week, I just got the box and I need to do something. There is no Apple store up here and the company that can do the repairs, messed up a iBook G4, so the only option is sending it out to apple care.
    Ideas and Suggestions?
    Geoff

    Well Holy Smoke !! Apple has agreed to let me get my data back a bit of a round about way but we will see.
    I am going to use a hard drive recovery service so it will go like this.
    A" local service provider," whom did not do anything at all to fix an iBook I gave them, under Apple Care to repair, but keep it 3 weeks and then said, I could not find anything by Goggling the problem...I see the problem that cursor is all over the place and jumps anywhere it wants., a problem came up and by the time we got back the iBook was out of warranty . Sometimes the local help is tough, but I try to support them.
    I think, with me standing there, they can remove the hard drive from my powerbook, it's pretty easy..
    Then, with Apple Care's blessing, I can send the drive into a recovery company, yes expensive, then return the drive in parts if that is the way it comes back, with my powerbook, ship it and AppleCare will fix it the PowerBook.
    That is really good, and if all goes well, I will be very impressed and not hesitate to get that new
    MBP. They even offered to let me take out the drive, but I thought, better to keep it in the "Apple Family."
    Now they did not send a letter or email to this effect, that would have made me feel better, but the attitude at Apple, has really changed, these people went multiple times to supervisors to get this answer and solution. Not the quickest way to get it fixed, but
    I am willing to bend, if they are willing to alter what is a well oiled line and will create a bump in their flow..
    We will see, I told them they just might get a bag of parts and I will not reinstall the bad drive, as it is most definitely shot. No problem, it's all in the notes the CSR said.
    We will see, but for today, this is sure a different attitude then the last go around, a few years ago. The CSR people are nice, understand English, as they seem to be based in Canada, which is a whole lot better then anywhere else I would want to talk too, or have talked to. They can understand abstract ideas, unlike those who just read from a card and stick to what the card says.
    I am holding my breath, but I hope to report that this all goes smooth. I liked it when Apple was a good company. People went out of their way to help you no matter it took to get it fixed or working. I think a company can be good, profitable, plus have a excellent CSR and repair program.
    For today at least, here is to Apple, way to go.
    Geoff

  • The statement did not return a result set in ireport

    Hi,
        I am Building a Report in iReport(Jasper Reports). I called a stored procedure from iReport by passing a parameter in Query Editor. I am getting an exception saying "The statement did not return a result set". When
    i use Temp Tables in stored procedure i am getting the exception.
    If there is no temptable in Stored procedure there wont be any exception.
    This is my Stored procedure
    Create PROCEDURE [XUSP_REPORT_SOPRINT] @BNUM VARCHAR(20) AS
    BEGIN
    DECLARE @FQTY BIGINT
    DECLARE @ITNAME VARCHAR(100)
    DECLARE @COUNT INT=0
    DECLARE @COUNT1 INT=0
    CREATE TABLE #BILL_PRINT(
        [BNUM] [varchar](20) NOT NULL,
        [CNAME] [varchar](30) NOT NULL,
        [CNUM] [int] NOT NULL,
        [ITNAME] [varchar](100) NOT NULL,
        [ITEM#] [int] NOT NULL,
        [QTY] [int] NOT NULL DEFAULT 0,
        [UNIT] [varchar](5) NOT NULL,
        [PRICE] [float] NOT NULL DEFAULT 0,
        [BASIC] [float] NOT NULL DEFAULT 0,
        [DISCOUNT] [float] NOT NULL DEFAULT 0,
        [FRQTY] [int] NOT NULL DEFAULT 0,
        [BADDR] [varchar](300) NULL,
        [CADDR] [varchar](300) NOT NULL,
        [BDATE] [datetime] NULL DEFAULT (sysdatetime()),
        [BILLBY] [varchar](50) NOT NULL,
        [ROUTE] [varchar](200) NULL,
        [AMT] [float] NOT NULL DEFAULT 0,
        [VAT] [float] NOT NULL DEFAULT 0,
        [VAT AMT] [float] NOT NULL DEFAULT 0,
        [AMT_AF_DISC] [float] NOT NULL DEFAULT 0,
        [AMT_AF_VAT] [float] NOT NULL DEFAULT 0,
        [TOT_DISC] [float] NOT NULL DEFAULT 0,
        [ROUND_OFF] [float] NOT NULL DEFAULT 0,
        [TOT_VAT] [float] NOT NULL DEFAULT 0,
        [AMT_UNDER_VAT] [float] NOT NULL DEFAULT 0,
        [NETT] [float] NOT NULL DEFAULT 0,
        [TOS] [varchar](30) NULL DEFAULT 0,
        [CDISC] [float] NOT NULL DEFAULT 0,
        [SDISC] [float] NOT NULL DEFAULT 0
    insert into #BILL_PRINT SELECT [BNUM]
          ,[CNAME]
          ,[CNUM]
          ,[ITNAME]
          ,[ITEM#]
          ,[QTY]
          ,[UNIT]
          ,[PRICE]
          ,[BASIC]
          ,[DISCOUNT]
          ,[FRQTY]
          ,[BADDR]
          ,[CADDR]
          ,[BDATE]
          ,[BILLBY]
          ,[ROUTE]
          ,[AMT]
          ,[VAT]
          ,[VAT AMT]
          ,[AMT_AF_DISC]
          ,[AMT_AF_VAT]
          ,[TOT_DISC]
          ,[ROUND_OFF]
          ,[TOT_VAT]
          ,[AMT_UNDER_VAT]
          ,[NETT]
          ,[TOS]
          ,[CDISC]
          ,[SDISC]
      FROM [SALES_DETAILS] WHERE BNUM=@BNUM
    CREATE TABLE #ITNAME_0
    ITEM VARCHAR(100) NOT NULL,
    FREE BIGINT NOT NULL
    INSERT INTO #ITNAME_0 SELECT ITNAME,FRQTY FROM SALES_DETAILS WHERE FRQTY<>0 AND BNUM=@BNUM
    --SELECT * FROM #ITNAME_0
    SET @COUNT=(SELECT COUNT(*) FROM #ITNAME_0)
    WHILE @COUNT!=0
    BEGIN
    SET @FQTY=(SELECT TOP(1) FREE FROM #ITNAME_0)
    SET @ITNAME=(SELECT TOP(1) ITEM FROM #ITNAME_0)
    SET @COUNT1=(SELECT COUNT(*) FROM #BILL_PRINT WHERE ITNAME=@ITNAME AND BNUM=@BNUM)
    IF @COUNT1=2
    BEGIN
        UPDATE #BILL_PRINT
        SET FRQTY+=@FQTY
        WHERE ITNAME=@ITNAME AND QTY<>0
        DELETE FROM #ITNAME_0 WHERE ITEM=@ITNAME AND FREE=@FQTY
        DELETE FROM #BILL_PRINT WHERE  ITNAME=@ITNAME AND QTY=0
    END
    SET @COUNT=@COUNT-1
    END
    --SELECT *FROM sales_details
    SELECT *FROM #BILL_PRINT where bnum=@bnum
    DROP TABLE #BILL_PRINT
    DROP TABLE #ITNAME_0
    END
    Please help me out in this.
    Thanks,
    Shreyas M

    This is a forum for Reporting Services (SSRS). If you're using Jasper reports then you should be posting in relevenat forums. I'm not sure there would be enough people with Jasper report experience here to help you out!
    Anyways in SSRS when  we use Temp tables in procedure it will throw exception in editor but when you save and run it will still work fine. Did you try saving it and executing report? Did the error still persisted?
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • I was told that I could not return a defective iphone!

    I ordered an iphone from apple.com. The screen was not screwed all the way down, so i had to take it to an apple store(hour and a half of my day which is a big hassle because i work alot and go to school full time.) to get checked out and eventually replaced. I immediately put an anti-glare screen protector on it. About a week later i removed the screen protector because i didn't like the affect it had of making the blacks look grey. The only problem is that the screen protector wasn't causing the greyish blacks. The screen itself was! So i set up an appointment yesterday, and went to the store today. They agreed that the screen was defective. They didn't have any 4 gb iphones in stock however and told me i'd have to come back another day when they come in. That of course is more of my time. I told them i would return the phone and just buy an 8gb (which they had in stock). They told me i couldn't return the iphone. I only had it for 12 days and it never worked. He said it was "against policy," which is of course just a cop-out way of saying "because i said so." I find it hard to believe that Apple would disallow returns of defective products and i also question its legality. I would like to think that it is just this store (they almost made we swear never to buy an apple product once before when they damaged my laptop in for repair, refused to admit to it, and insinuated that I am a lier.
    Has anyone else had this much trouble with apple? Because i am becoming fed up.
    (oh and they better not try to pawn a refurb off on me. It never worked in the first place and i did not pay full price for a refurb iphone)

    Apple appears to be 'cracking down' on their returns more lately. When the iPhone was first released and for about 2 months afterwards, they were taking in returns no problem, replacing defective iPhones with brand new ones in the box, etc. Now they seem to be doing everything in their power to NOT return them or replace them. Sounds a lot like an insuance company. I guess that's what happens when you put a lot of defective product out there.
    If I were you Dan Pallas, I'd just go back to the store with my reciept and my iPhone and return the whole thing. How can they deny a return? They can't if it's in the 14 days. When they charge you the 10% restocking fee, pay it but let the manager know you're not buying anything else. Tell him or her that you were going to buy an 8GB phone at a higher cost, thus giving Apple more money but now no way. Remind him that good customer service is at places like Costco where you can return an item for 90 days and NO restocking fee.
    I know you want an iPhone, but isn't this policy ridiculous? Show them that you think it's ridiculous.
    I find it absurd that I can buy an iPod at Apple and have a 14 day return policy, replacement with a refurb and a 10% restocking fee. Yet, I can go to Costco and buy the same iPod and have a 90 day return policy, free techincal support, and NO restocking fee if I need to return it within those 90 days, as well as get a brand new non-refurbished iPod. AND that same iPod is $10 cheaper than at Apple. Guess who gets my business?

Maybe you are looking for