Getting Bitmaps from files uses excessive memory

When I load a jpg picture as a bitmap I lose a lot of memory that I am unable to recover.
I use the GetBitmapfromfile, the GetBitmapInfo, then GetBitmapData, then DiscardBitmap.
after this I have about 120 M of memory (for a 5 M pixel image) missing that I cannot recover.  The size of this lost memory is proportional to the number of pixels in the image.
Solved!
Go to Solution.

Hi Kelly
Thanks for your response.  I am using CVI 8.1.0.  I detect the memory through using windows task manager. 
My real problem is that my final application is using too much memory and going into virtual memory too much, when I have been tracing my memory usage I have a lot of memory unaccounted for and I cannot get it back.  This happens when I load the bitmap, and cannot be recovered untill my program is stopped.
I have attached some code with pictures to try (use the 2 DSCxxx for comparision to my run).  I have also enclosed screen shots so you can see how the memory is used on my PC.  Sorry for the large file size, I thought it best to send the same sample photos I have been using.
Attachments:
CVI Test.zip ‏4944 KB

Similar Messages

  • Why does AVG Internet Security keep warning me that Firefox is using excessive memory and advisin me to close it and reopen?

    My browser was open and I was on Facebook. A message appeared from AVG Internet Security 2012, which is operating on my computer, telling me that FireFox was using excessive memory -- "260 MB of memory" and suggesting I close FireFox and reopen.
    This has happened several times; also when I was on CNN and Yahoo webpages.

    How much RAM do you have?
    300MB is a lot if you only have 512MB, but not too much if you have 1 or 2 GB, or more.
    http://blogs.avg.com/community/avg-feedback-update-week-44/
    See - 3. AVG Advisor = Disable AVG Advisor performance notifications <br />
    or try using the "Change when these notifications appear" and set a higher threshhold

  • Get data from file in server to client and vice versa

    after greeting
    i really didn't know how to use socket and serversocket to get data from file in the server and display it to client.
    also read file from client and save it to server.
    really i didn't know how to do it.
    really i want the reply as soon as possible

    You REALLY need to work through the Java networking tutorials:
    http://java.sun.com/docs/books/tutorial/networking/index.html

  • I got an android, turned off my imessage on my iphone and deactivated the iphone through apple support but I still don't get messages from people using iphones.  What's wrong?

    I got an android, turned off my imessage on my iphone and deactivated the iphone through apple support but I still don't get messages from people using iphones.  What's wrong?

    Go ahead and call AppleCare at 1-800-692-7753 and ask them to revoked your certificate

  • Since installing the last update I am getting warnings through AVG that friefox is using excessive memory - 215 MB. Please provide input as to whteher this is a matter of concern becuase the window is coming up constantly.

    I am on a dell 620 laptop. Every time I get on Firefox, an AVG window is popping up saying that excessive memory is being used (215 MB) and it recommends that I log out and log back in for faster processing. Logging out does not make a difference. The last update also disabled my AVG tool bar from the internet screen which I am not sure matters much, but I am concerned about the excessive memory use warning. Can you please provide me guidance about this matter?

    Thanks but I have no idea how to do that and don't know the purpose of the add- ons or what is considered critical in the updates so that is outside of my knowledge level and comfort. How do I find out what is critical in the update without devoting a major chunk of my life to it? This is getting frustrating from my perspective. I am going to contact AVG and ask them how this pop up is gauging what to interpret critical memory use. If you have any other thoughts they are appreciated

  • Why Does Safari Use Excessive Memory with Gmail?

    I am running Safari 7.0.1 along with Maverics (10.9.1) on a 2011 MacBook Air with 4 GB of memory. Just recently I have begun to notice excessive memory usage when using Gmail. I have iStat Menus as well as something called MemoryKeeper so I can monitor memory use in real time.
    The table below shows numbers taken from Activity Monitor with each of the sites running in a single tab.  The Safari Web Content is through the roof with Gmail compared to My Yahoo or indeed with any other single site. In Gmail it starts out above 500 MB and slowly comes down to the lower end indicated if I do nothing. If I open tabs with both My Yahoo and Gmail, I sink below 100 MB and if I have three tabs open I'm heading to zero. As far as I can tell, the excessive memory useage only occurs with Gmail.
    Process
    Yahoo
    Gmail
    Safari
    156 MB
    167 MB
    Safari Web Content
    96 MB
    531-338 MB
    Kernel Task
    464 MB
    464 MB
    Free
    662 MB
    210 MB
    Typically I will close Safari and start it again if I get much below 100 MB. I usually have to close Safari at the end of the day to refresh it for the next day. This has only become a problem within the last month or so, and I am at a loss to explain it. I thought it might be Mavericks related (though I have been running Mavericks since its release), but then the Safari I have on my 5 year old Mac Mini running Snow Leopard gives me similar results.
    When I run Google Chrome I don't have any of these problems. Indeed, though it is not my preference, I am having to use it more and more for day to day activities or I have to stick with one tab if I am going back and forth between Gmail and other sites. I have not seen this problem reported elsewhere, so I have to believe there is something going on in my system. I have cleared the cache one time on both systems, but that doesn't seem to have made any difference. I would appreciate any comments or suggestions.
    -Bill

    I would not have even tried this app had I not heard about it on the Mac Rountable podcast (episode #222), where it received favorable comments from otherwise knowledgeable people. It also has a 4.5 star rating on the Mac App Store with 706 5-Star ratings out of 1,049. If you add up the 5-Star and 4-Star ratings you get close to 1,000 favorable rates right there. I have to wonder if people really know what's going on. Since the most obvious detrimental effects for me were centered around using Safari with Gmail on Mavericks, others must not be using that lethal combination. As I mentioned, using Google Chrome does not seem to have any obvious deliterious effects.
    Well, there's going to be one more 1-Star rating reflecting my experience.
    -Bill

  • Create thumbnail using excessive memory

    I have the following code to read an image (in a file) and create a thumbnail image, writing it to a file:
    BufferedImage originalBufferedImage = ImageIO.read(new File(imagePathAndFileName));
    int originalWidth = originalBufferedImage.getWidth();
    int originalHeight = originalBufferedImage.getHeight();
    double scale = 0;
    if (((double)75 / originalWidth) <
    ((double)75 / originalHeight)) {
    scale = (double)75 / originalWidth;
    } else {
    scale = (double)75 / originalHeight;
    int width = (int)(originalWidth * scale);
    int height = (int)(originalHeight * scale);
    BufferedImage newBufferedImage = new BufferedImage(width, height, originalBufferedImage.getType());
    Graphics2D graphics2D = newBufferedImage.createGraphics();
    Canvas dummyObserver = new Canvas();
    Image scaledImage = originalBufferedImage.getScaledInstance(width, height, Image.SCALE_SMOOTH);
    graphics2D.drawImage(scaledImage, 0, 0, dummyObserver);
    javax.imageio.ImageIO.write(newBufferedImage, fileType, new File(thumbnailPathAndFileName));
    With a 1.9 Megabyte image, the call to ImageIO.read() tries to allocate 15 Megabytes of memory, as seen from the log (obtained in WebSphere 5.1 by setting an ALLOCATION_THRESHOLD limit):
    Allocation request for 15085072 bytes
    at java.awt.image.DataBufferByte.<init>(DataBufferByte.java:87)
    at java.awt.image.ComponentSampleModel.createDataBuffer(ComponentSampleModel.java:430)
    at java.awt.image.Raster.createWritableRaster(Raster.java:965)
    at javax.imageio.ImageTypeSpecifier.createBufferedImage(ImageTypeSpecifier.java:1146)
    at javax.imageio.ImageReader.getDestination(ImageReader.java:2868)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:914)
    at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:886)
    at javax.imageio.ImageIO.read(ImageIO.java:1413)
    at javax.imageio.ImageIO.read(ImageIO.java:1299)
    Why does it use 15M to read in an image of 1.9M ? Is there a more efficient way to create thumbnail images?

    A 15M image correponds to a 5M-pixel RGB 24-bit image. "ImageIO.read" decodes your 1.9M compressed jpeg (beeing roughly a 5Mpixel image, right?) file to a buffered image of some in-memory RGB 24bit format making it consuming 15M. You can get away with using less memory if you can find some ImageIO plugin returning a BufferedImage of type TYPE_CUSTOM with a compressed in-memory representation of the loaded image.
    Regards,
    Arvid

  • How to get FILENAME from FILE PATH

    does anyone know how to get filename from a file path for example
    FILE PATH: C:\Project\uploadbean\web\uploads\Button.txt
    returns
    FILENAME: Button.txt

    @BalusC
    ust for a reference cause i'm new in JSP This has nothing to do with JSP, but with basic knowledge of an essential API. I have given you the link to the File API. Are you saying that you refused to read the API documentation, which clearly explains you how to use the File and shows which methods are all available to you undereach the straightforward getName() method, and expecting that the others may chew the answers for you? Loser.

  • Can't Create PDF "from file" using any MS Office files

    Acrobat 8.1.1 Pro. (OS = XP), as part of the CS3 premium edition.
    I can no longer get Acrobat to recognize any of the MS Office applications extensions (.doc, .ppt, etc...) for use with either Create PDF "From File" or when using the Combine Files feature to Merge or Package. The extensions are no longer even listed as an option in the dialog box, or in the Preference settings under "Convert to PDF".
    FYI- I can still use the PDF Maker functionality from within the MS Office application to create a PDF.
    Any Idea what could have happened, or more importantly how to fix?
    ***Update***
    I have re-installed the Acrobat 8 application, and the problem still exists.
    I'm truly puzzled.

    I get this with my PC and I ran detect-repair and reinstalled. Some PDF's I can open and other's I cannot. I can send the email to a cohort and they can open fine.
    "Can't create file: Right-click the folder you want to create the file in and then click Properties on the shortcut menu to check your permissions for the folder"
    Any ideas would be great.
    Thanks!

  • Data Integrator has no read permissions to get the data file using FTP

    Hi,
    I wonder if you could help.
    We have installed the data integrator and are using FTP to get the data file from the SAP server to the DI server. The files are created by the SAP admin user with permissions 660. The FTP user is not in the sapsys group so cannot read the files.
    Has anyone come accross this problem and how did you solve it?
    Many thanks.

    Hi,
    you might want to put you entry into the EIM forum where also the Data Integrator topics are being handled:
    Data Services and Data Quality
    Ingo

  • Extract records from file using RegEx

    Hi guys,
    I was wondering if there's a way to extract records from a text file using regular expressions matching groups in Endeca Integrator.
    I have several XML files and I have mapped and extracted records from them using XML Reader component, but I need to preserve the tags of mapped elements. For example, if I have the following XML:
    <Msg><Para>Some text. <Emphasis>More text</Emphasis><Para></Msg>
    mapping Msg element to an output cloverField will return "Some text. More text". I need to preserve tags, so I need an output like: "<Msg><Para>Some text. <Emphasis>More text</Emphasis><Para></Msg>",
    I don't know if there's a way to accomplish this by modifying the setting of the XML Reader component, but I was thinking of using regular expressions to solve this. Unfortunately, I can't find a way to do it by using the built-in components in Integrator.
    The final solution is do it programmatically without using Integrator, but I want to know if I'm missing something.
    Thanks in advance.

    This will get the name and extension in separate variables
    set vTheFile to (choose file) as text
    set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, ":"}
    set vPath to (vTheFile's text items 1 thru -2 as text)
    -- Add this for the file name
    set vFile to vTheFile's text item -1
    -- This will get the name and extension as  seperate items
    set AppleScript's text item delimiters to "."
    set {vFileName, VfileNameExtension} to {text item 1 of vFile, text item 2 of vFile}
    set AppleScript's text item delimiters to TempTID
    display dialog "Path is: " & vPath & return & return & "File is: " & vFile & return & "File name is: " & vFileName & return & "Extension is : " & VfileNameExtension
    (but I think I am done now)

  • Help needed with variable - trying to get data from Oracle using linked svr

    Sorry if I posted this in the wrong forum - I just didn't know where to post it.
    I'm trying to write a simple stored procedure to get data from an oracle database via a linked server in SQL Enterprise manager. I have no idea how to pass a variable to oracle.
    Here's how I would get the variable in SQL:
    declare @maxkey INTEGER
    select @maxkey= MAX(keyfield) from [server].Data_Warehouse.dbo.mytable
    select * from [server].Data_Warehouse.dbo.mydetailtable where keyfield=@maxkey
    the select statement I need to do in oracle would use that variable like this:
    select * from OPENQUERY(OracleLinkedServer,'select
    * from ORACLEDB.TABLE where keyfield > @maxkey')
    and I get this message: OLE DB provider "OraOLEDB.Oracle" for linked server "OracleLinkedServer" returned message "ORA-00936: missing expression".
    I realize that I can't pass the @maxkey variable to oracle - so how do I accomplish this?

    Please refer the example in this link which deals with Oracle date format.
    You can finnd a command DECODE which is used for date formats. If you have a look at whole theory then you will get an idea.
    Link:[Bulk insert SQL command to transfer data from SAP to Oracle|http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bulk-insert-sql-command-to-transfer-data-from-sap-to-oracle-cl_sql_connection-3780804]

  • How to get data from Oracle using Native SQL in SAP.. Problem with date

    Hi Masters.
    I'm trying to get data from an Oracle DB. I was able to connect to Oracle using tcode DBCO. The connetion works fine
    I wrote this code and it works fine without the statement of where date > '01-09-2010'
    But i need that statement on the select. I read a lot about this issue, but no answer.
    My code is (this code is in SAP ECC 6.0)
    DATA: BEGIN OF datos OCCURS 0,
          id_numeric(10),
          component_name(40),
          comuna(10),
          record_id(10),
          status,
          sampled_date(10),
          END OF datos.
    DATA: c TYPE cursor.
    EXEC SQL.
      connect to 'LIM' as 'MYDB'
    ENDEXEC.
    EXEC SQL.
      SET CONNECTION 'MYDB'
    ENDEXEC.
    EXEC SQL PERFORMING loop_output.
      SELECT ID_NUMERIC, COMPONENT_NAME, COMUNA, RECORD_ID, STATUS, SAMPLED_DATE
      into :datos from lims.SAMP_TEST_RESULT
      where     date > '01-09-2010'
    ENDEXEC.
    EXEC SQL.
      disconnect 'MYDB'
    ENDEXEC.
    How can i get the data from that date?? If i delete the where statemet, the program works well, it takes 30 mins and show all the data, I just need the data from that date.
    Any help
    Regards

    Please refer the example in this link which deals with Oracle date format.
    You can finnd a command DECODE which is used for date formats. If you have a look at whole theory then you will get an idea.
    Link:[Bulk insert SQL command to transfer data from SAP to Oracle|http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bulk-insert-sql-command-to-transfer-data-from-sap-to-oracle-cl_sql_connection-3780804]

  • Getting empty csv file using servlet

    Hi
    i am working on reports for my web application and i used struts frame work.
    for my reports i want csv export, so for that i written servlet, once if i click generate button i am able to open popup window to save the generated csv file at my local system, but i am getting emplty csv file..
    nothing si ther ein that file forget abt data atleast my header fields.
    here is my servlet file..plz let me know where i am doing wrong..
    public class ReportServlet extends HttpServlet{
         public void doPost(HttpServletRequest req,HttpServletResponse res)
    throws ServletException,IOException
    PrintWriter out = res.getWriter();
    res.setContentType("text/csv");
    res.setHeader("Content-Disposition","attachment; filename=\"export.csv\"");
    out = res.getWriter();
    AdvDetailReportBean reportBean = null;
    ArrayList list =(ArrayList)req.getSession().getAttribute("advreportlist");
    System.out.println(" servlet report list size is"+list.size());
    String branchcode=(String)req.getSession().getAttribute("branchcode");
              String bName=(String)req.getSession().getAttribute("branchname");
              System.out.println(" servlet branch name"+bName);
              System.out.println(" servlet branch code"+branchcode);
    StringBuffer fw = new StringBuffer();
              fw.append("Branch Code");
              fw.append(',');
              fw.append("Branch Name");
              fw.append('\n');
              fw.append(branchcode);
              fw.append(',');
              fw.append(bName);
              fw.append('\n');                              
              fw.append('\n');
              fw.append("Customer Name");
         fw.append(',');
         fw.append("Constitution Code");
         fw.append(',');
         fw.append("Customer Status");
         fw.append(',');
         fw.append("Restructure Date");
         fw.append(',');
         fw.append("Total Provision");
         fw.append(',');
         fw.append("Limit Sanctioned");
         fw.append(',');
         fw.append("Principal");
         fw.append(',');
         fw.append("Balance");
         fw.append(',');
         fw.append("AccountID");
         fw.append(',');
         fw.append("Collateral SL No");
         fw.append(',');
         fw.append("Issue Date Of Collateral");
         fw.append(',');
         fw.append("MaturityDate Of Collateral");
         fw.append(',');
         fw.append("Subsidy");
         fw.append(',');
         fw.append("Guarantor SL No");
         fw.append(',');
         fw.append("Guarantor Rating Agency ");
         fw.append(',');
         fw.append("External Rating of Guarantor");
         fw.append(',');
         fw.append("Rating Expiry Date");
         fw.append(',');
         fw.append("Guarantee Amount");
         fw.append(',');
         fw.append('\n');
         for (Iterator it = list.iterator(); it.hasNext(); )
              reportBean = new AdvDetailReportBean();
              reportBean = (AdvDetailReportBean)it.next();
              fw.append(reportBean.getCustomername());
              fw.append(',');
              fw.append(reportBean.getConstitutionCode());
              fw.append(',');
              fw.append(reportBean.getCustomerStatus());
              fw.append(',');
              fw.append(reportBean.getRestructureDate());
         fw.append(',');
         fw.append(reportBean.getTotalProvision());
         fw.append(',');
         fw.append(reportBean.getLimitSanctioned());
         fw.append(',');
         fw.append(reportBean.getPrincipal());
         fw.append(',');
         fw.append(reportBean.getBalance());
         fw.append(',');
         fw.append(reportBean.getCurrentValue());
         fw.append(',');
         fw.append(reportBean.getAccountNumber());
         fw.append(',');
         fw.append(reportBean.getColCRMSecId());
         fw.append(',');
         fw.append(reportBean.getIssueDt());
         fw.append(',');
         fw.append(reportBean.getMarturityDt());
         fw.append(',');
         fw.append(reportBean.getUnAdjSubSidy());
         fw.append(',');
         fw.append(reportBean.getGuarantorFacilityId());
         fw.append(',');
         fw.append(reportBean.getRatingAgency());
         fw.append(',');
         fw.append(reportBean.getExternalRating());
         fw.append(',');
         fw.append(reportBean.getExpDtOfRating());
         fw.append(',');
         fw.append(reportBean.getGuaranteeAmt());
         fw.append(',');
         fw.append('\n');
    }

    You don't seem to be writing anything to the response at all. Yes, you create a StringBuffer and write lots of stuff to the StringBuffer but then you do nothing else with that buffer.

  • Getting data from file to array

    try
        System.out.println("Enter file name: ");
        fileName = Object.nextLine();
        BufferedReader inputStream =
                new BufferedReader(new FileReader(fileName));
        String employee = null;
        employee = inputStream.readLine();
        System.out.println("The first employee in " + fileName + " is");
        System.out.println(employee);
        inputStream.close();
    catch(FileNotFoundException e)
        System.out.println("File " + fileName + " not found ");
    catch(IOException e)
        System.out.println("Error reading from file " + fileName);
    }This is just a little example I made. You can look at my other thread to see the other code. I need to put the data in a file into the array. Does it need to be casted somehow?

    public void getData()
           try {
       System.out.println("Enter file name to read: ");
       File = Object.nextLine();
       BufferedReader Object =
                new BufferedReader(new FileReader(File));
        for(int i = 0; i < people.length && people[i] != null; i++)
    String temp = Object.readLine();
    people.setLastname(temp);
    temp = Object.readLine();
    people[i].setFirstname(temp);
    temp = Object.readLine();
    people[i].setID(temp);
    temp = Object.readLine();
    people[i].setPhone(temp);
    temp = Object.readLine();
    people[i].setYearlySalary(Double.parseDouble(temp));
    temp = Object.readLine();
    people[i].calcBonus(Double.parseDouble(temp));
    temp = Object.readLine();
    people[i].getMonthlyPay(temp));
    } Object.close(); }I know, I got careless with the naming. I'm trying a different route now. I think I can just do it in reverse. lol How would I get the method getMonthlyPay to have no errors. It's a public void() method with monthlyPay = (yearlySalary + bonus) / 12; in its definition.
    anyone?
    Edited by: Program_1 on Dec 9, 2007 5:42 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Maybe you are looking for

  • How to change an approver in shopping cart( by function module ) ?

    Hello, i wish to change my approver ( not through the portal) but by function module ( or some other way) .  Then, the creator of the SC will see the new approver in his cart details and also, when the new approver logs in, he will have the shopping

  • N95, wrong text spelling predictive

    having a problem with my N95. if typing in a text and i type in "you" i get "yot". if i press the button to change the word to the next selected one i get "you". but its a bind and the phone seems to have learnt a new word which it thinks i want to u

  • Ideapad s210 Touch Sound Problem

    Hi, I seem to have a weird sound issue with my laptop. I got the following message when i tried to play an audio on windows player. Link to image 1 But when i started the computer previously, it still produced the windows start up sound. And there's

  • Photo library does not sync in iOS4 after upgrade in 3GS

    Hi all, Photo library does not sync in iOS4 after upgrade in 3GS. Anyone having such problems?

  • Aborting ALBPM process instance gracefully.

    I am trying to implement cascade abort functionality for instances of ALBPM processes. Since ALBPM Studio currently doesn't provide any feature that you could set some property for associating sub processes during design time that child process life