How to clean the memory after calling BitmapData.draw() ?

If you add the embedded image on the Stage 800x600 flash player will spend 17Mb RAM / 14Mb Virtual
But if you create 1200 sprites (in every 100 circles), call draw (), remove the sprites and force to call Garbage Collector, flash player will spend much more - 36Mb RAM / 33Mb Virtual
var container:Sprite = new Sprite();
// adding 1200 sprites
var shiftX:Number = 10;
var shiftY:Number = 10;
for (var i:int = 0; i < 1200; i++) {
     var circle:Sprite = new Sprite();
     // drawing 100 circles
     for (var j:int = 0; j < 100; j++) {
          circle.graphics.beginFill(0xFFFFFF/j*i);
          circle.graphics.drawCircle(0, 0, 10-j*.1);                        
     circle.x = shiftX;
     circle.y = shiftY;
     shiftX += 20;
     if ( shiftX >= stage.stageWidth ) {
          shiftX = 10;
          shiftY += 20;
     container.addChild(circle);
// draw() and adding bitmap
var bmd:BitmapData = new BitmapData(800, 600, true, 0x00FFFFFF);
bmd.draw(container);
var bmp:Bitmap = new Bitmap(bmd, "auto", true);
addChild(bmp);
// removing sprites
while (container.numChildren) container.removeChild(container.getChildAt(0));
// Force Garbage Collector 1
System.gc();
System.gc();
// Force Garbage Collector 2
try {
     new LocalConnection().connect('foo');
     new LocalConnection().connect('foo');
} catch (e:Error) {}
What happens to memory?

Is there any issue with JavaFX? or I have to do something else?It's likely an issue with your application code (though it could be a bug in the JavaFX platform too).
Either way debugging most memory issues in JavaFX (except for ones the graphics card texture related) is the same as debugging them in Java - so just use standard Java profiling tools to try to track down any memory leaks you have.
Such work is as much an art as a science and takes some experience to get right, so grab your detective cap, download and use the tools linked and try and track it down:
http://stackoverflow.com/questions/6470651/creating-a-memory-leak-with-java
http://resources.ej-technologies.com/jprofiler/help/doc/indexRedirect.html?http&&&resources.ej-technologies.com/jprofiler/help/doc/helptopics/memory/memoryLeak.html
http://www.ej-technologies.com/products/jprofiler/overview.html (recommended tool).
http://visualvm.java.net/
http://netbeans.org/kb/articles/nb-profiler-uncoveringleaks_pt1.html
http://www.ibm.com/developerworks/library/j-leaks/ (this link is really old and somewhat outdated but explains some of the underlying concepts better than some newer articles I found).

Similar Messages

  • How can restore the memory after deleting parallels?

    I recently deleted my paralles program and wonder if the memory that it had been taking up has now been restored to my computer or if it is still partisioned off. I ask this because when I installed paralles, my mac asked me how much memory I wanted to give to paralles.
    Thanks for your help!

    Some ways to get space
    You can first remove seldom used apps. If you decide later you want them back you can always download them again. You can also download the Dropbox app and off load some of your little used pics and files to open up space. The app is free and you get 2 gb of free storage and if you get friends to install Dropbox they will give you 500 extra mb for each friend who installs it. Many apps will let you save direct to Dropbox.

  • How to make the Commit after calling a BAPI from SE37 ?

    Hi
    When i use a BAPI for update some SAP table i always call the BAPI inside a program and then i call the BAPI_TRANSACTION_COMMIT for made the changes and validate them
    Bot now i need to test the BAPI directly in SE37 , and the BAPI returns the sucess message but i can not see the changes in the SAP tables , i guess i need to make the Commit but how can i do this ? 
    by calling the BAPI_TRANSACTION_COMMIT directly in SE37 after the call to the other BAPI  ?
    Thanks
    Frank

    se37 > clear the field of the function module name
    menu path: Function module > test > test sequence and give you FM's sequence you want to test

  • How to free the memory after closing JavaFX Stage?

    I am creating a JavaFx application which contain a button. When I click on that button, it opens a new stage containing a table with thousands of data. It's working fine. But the problem is, when I close the Stage of that table, memory is not getting free by the application i.e. everytime when I open the new stage for table then memory is get increased. Is there any issue with JavaFX? or I have to do something else?
    I have tried to set everything null at the time of closing of that stage but still memory is not getting free.
    My button click code is :
    btn.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent event) {
                    Stage stage = new Stage();
                    Table1Controller controller = (Table1Controller) Utility.replaceScene("/tablesample/Table1.fxml", stage);
                    controller.init(stage);
                    stage.setTitle("Sample");
                    stage.setWidth(583.0);
                    stage.setHeight(485.0);
                    stage.initModality(Modality.APPLICATION_MODAL);
                    InputStream in = TableSample.class.getResourceAsStream("icon_small.png");
                    try {
                        stage.getIcons().add(new Image(in));
                    } finally {
                        try {
                            in.close();
                        } catch (IOException ex) {
                    stage.show();
    Utility.replacescene method : It loads the scene from given fxml and set to stage. At final It return controller object for that scene.
    public static Initializable replaceScene(String fXml, Stage mystage) {
            InputStream in = null;
            try {
                FXMLLoader loader = new FXMLLoader();
                in = Utility.class.getResourceAsStream(fXml);
                loader.setLocation(Utility.class.getResource(fXml));
                loader.setBuilderFactory(new JavaFXBuilderFactory());
                AnchorPane page;
                try {
                    page = (AnchorPane) loader.load(in);
                } finally {
                    in.close();
                Scene scene = new Scene(page);
                mystage.setScene(scene);
                return loader.getController();
            } catch (Exception ex) {
                return null;
        }Thanks

    Is there any issue with JavaFX? or I have to do something else?It's likely an issue with your application code (though it could be a bug in the JavaFX platform too).
    Either way debugging most memory issues in JavaFX (except for ones the graphics card texture related) is the same as debugging them in Java - so just use standard Java profiling tools to try to track down any memory leaks you have.
    Such work is as much an art as a science and takes some experience to get right, so grab your detective cap, download and use the tools linked and try and track it down:
    http://stackoverflow.com/questions/6470651/creating-a-memory-leak-with-java
    http://resources.ej-technologies.com/jprofiler/help/doc/indexRedirect.html?http&&&resources.ej-technologies.com/jprofiler/help/doc/helptopics/memory/memoryLeak.html
    http://www.ej-technologies.com/products/jprofiler/overview.html (recommended tool).
    http://visualvm.java.net/
    http://netbeans.org/kb/articles/nb-profiler-uncoveringleaks_pt1.html
    http://www.ibm.com/developerworks/library/j-leaks/ (this link is really old and somewhat outdated but explains some of the underlying concepts better than some newer articles I found).

  • How clean the memory

    How can clean the memory on my ipad?

    Settings>General>Reset>Erase all content and settings.
    Warning: All data will be gone.

  • How to clean the windows registry after an unclean install or previous SP2/SP1 uninstall.

    How to clean the windows registry after an unclean install or previous SP2/SP1 uninstall.
    <b>Procedure:</b>
    Run regedit -
    1. Go to HKEY_LOCAL_MACHINE\Software and delete iPlanet folder,
    2. Go to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services delete the entries for :  adminXXX-serv,  iAS60, slapd4.1, slapd-servername.
    Run regedt32 -
    1. Go to HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Enum/Root    changed the permission for key LEGACY_SLAPD-xxx from security, and delete it,    check in other controlSet (002/003) also,  including currentControlSet.
    If you are cleaning the Registry after an uninstall, than after cleaning
    registry delete the iAS home dir and "reboot" the computer.

    Sanjeev:
    Maybe you can help. I haven't been able to resolve this one "small" problem which is preventing me from rolling out iWS6.0 SP2. I created a new instance of the server using "Add Server" so that I have 2 Web sites (e.g. test1.domain.com and test2.domain.com), but the 2nd server instance is pointing to the same HTML location as the first (i.e. http://test2.domain.com takes you to the same location as http://test1.domain.com). What do I need to change and where to fix this? Need a VERY quick answer to this to implement a production Web server. I've tried the suggestions made so far (see: http://softwareforum.sun.com/servlet/ProcessRequest?RHIVEID=181&RPAGEID=135&HOID=50B500000008000000966A0000&UCATEGORY_0=_23_%24_6_&UCATEGORY_S=0&USEARCHCONTEXT_QUESTION_0=server+instances&USEARCHCONTEXT_QUESTION_S=0) but nothing has resolved this problem. If you have any ideas at all, I'd appreciate if you could let me know :)
    Thanks!

  • How to Clean the Call Speakers - Lumia 920

    This is a bad idea if you have a Lumia 920. Maybe you could try this on other phones but the quality of the Lumia 920 just pushes the dust around the inside of the phone and into the front camera somehow. I have had 3 Lumia 920 and the first two suffer from dust in the front camera which I think also affects the proximity sensor. I though that I was treating the phone wrong but it also happened to the windows store guy. There was an article on Windowsphonecentral.com about this and as for learning how to clean the speakers I would like to find out too.
    Moderator's Note: A more appropriate subject was provided as this post was moved to the appropriate board.

    You could use anti static cloth or compressed air to clean ive seen people using hoovers etc NOT ADVISABLE.
    I would sent it to nokia care are its a known issue,it will be done under warranty.
    If  i have helped at all a click on the white star below would be nice thanks.
    Now using the Lumia 1520

  • How to enable the screen after triggering the error message

    Hi All,
    we have a tcode IW31, in that one field(WBS element -PROID) is not mandatory. so we have written the following code to make it mandatory in a user exit EXIT_SAPLCOIH_010.It's triggering the error message, but it is going into disable mode. Please sugget me how to enable the screen after getting the error message triggering.
    if not caufvd_imp-proid is initial.
      select single * from t350 into wa_t350
              where  auart    = caufvd_imp-auart
                and  imord    = 'X'.
      if sy-subrc is initial.
        pspel = caufvd_imp-proid.
      else.
        call function 'CONVERSION_EXIT_ABPSP_OUTPUT'
             exporting
                  input  = caufvd_imp-proid
             importing
                  output = l_posid.
        concatenate text-t10 l_posid text-t11
                    into l_textline1 separated by space.
        message i208(00) with l_textline1.
      endif.
    else.
      message e208(00) with 'Please maintain WBS element in Location Tab'.
    endif.
    Thanks

    Hi,
    Instead of error message use status message like
    message s208(00) with 'Please maintain WBS element in Location Tab'.
    Leave to screen sy-synnr.
    This will allow to move to the screen and have in enable mode.
    WIth Regards,
    Dwaraka.S
    Edited by: Dwarakanath Sankarayogi on Feb 13, 2009 7:46 AM

  • How to get the memory address of an array (pointer in C)?

    I am writing an application that exchanges data with a PXI device via DMA.  Basically I will provide it a memory address and a direction, and it transfers the data.  I would like to give it the memory location of an array in LabVIEW, but I do not know how to get the memory location without doing a DLL call to C code that returns the pointer.  Is there an easy way to do this in LabVIEW?  Any help is much appreciated.

    A similar question was asked recently regarding strings. You cannot pass pointers in LabVIEW as you do in C. You can pass an array to a DLL, but that means you would need to write a wrapper DLL. Be sure to read the section in the LabVIEW Help on calling code from text-based languages and also take a look at the "Call DLL" example that ships with LabVIEW  - it contains many examples of how to deal with various datatypes.

  • How to clean the PC of QT and reinstall qt7.6?

    1) QT-7.6 loads on XP-prof_sp3 OS PC with DirectX-9, but on running gives error as follows:
    DLL server window: QTplayer.exe - Application error:
    The exception unknown software exception (0xc0000409) occurred in the application at location 0x0040130d.
    2) After repeated trials in installation the QT-7.x, it is neither running nor de-installing from start-up or control panel. It rolls back de-installation after almost completing it.
    3) Also tried QT removal from system as given in the qt-support site i.e delete folders and qt files from win/system32 and recycle bin after de-installing using regcleaner>qt de-install using qt uninstall start-up menu>run regclean>shutdown>restart>reinstall qt-7.6>gives installation error now....???
    4) How to clean the PC of QT.
    Please help
    as

    Please refer to the below shown link as I feel this might be helpful to you
    http://www.instructables.com/id/Clean-Your-Sticky-Laptop-Keyboard/?ALLSTEPS
    Hope this helps, for any further queries reply to the post and feel free to join us again
    **Click the KUDOS star on left to say Thanks**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.
    Thank You,
    K N R K
    Although I am an HP employee, I am speaking for myself and not for HP

  • How to clean the whole cooling system of Qosmio X770-107

    Hi Guys,
    is there any manual, how to clean the whole cooling system of an X770-107 Gaming Notebook??
    I can try to clean the dust on the intake and outtake of the laptop, but whats in the middlepart of the cooling system??
    Any Ideas??

    As Tonny already wrote all you can do is to use compressed air and try to clean t up.
    For professional clean-up the whole notebook must be disassembled. After doing this there is full access to all cooling modules.
    Of course this must be done by authorized personal only. Some kind of maintenance manual is not a public document. What you can do is to contact nearest Toshiba service and ask how much such professional clean-up costs.
    By the way: this notebook cannot be so old so I dont think it is full of dust.

  • How to clean the Admin Console Library of Resources?

    Hi,
    Could anybody point me how to clean the library of books, pages and portlets of the admin console library? It's full of old elements not in use anymore.
    Thanks in advance,
    leandro

    With reference to steps in
    Oracle® Business Intelligence Applications Installation Guide for Informatica PowerCenter Users Version 7.9.6 Part Number E14217-01
    Chapter 4, "Installing and Setting Up Oracle BI Applications."
    http://download.oracle.com/docs/cd/E14223_01/index.htm
    I think I had a similar error at step
    "4.6.3 Creating the Informatica Repository Service"
    "The repository code page [106: UTF-8 encoding of Unicode]
    does not match the code page specified for the corresponding
    Repository Service in the Administration Console
    [2252: MS Windows Latin 1 (ANSI), superset of Latin1]."
    you must create the repository service with a matching code page
    - remember that the code page cannot be changed after the Repository Service is created
    Service Name = RepositoryService
    CodePage = UTF-8 (Unicode)
    later on at step "4.6.4 Creating the Informatica Integration Service"
    it throws
    "LM_36011 Code page mismatch. Service process is running in code page
    [ISO 8859-1 Western European] whereas the service is configured
    in the Admin Console to run in code page [UTF-8 encoding of Unicode]"
    so I had to set the language env variables before starting the service
    export LANG=en_GB.utf-8
    export LC_ALL="en_GB.utf-8"
    export INFA_HOME=/u01/app/oracle/product/8.6.0/etl_1
    $INFA_HOME/server/tomcat/bin/infaservice.sh startup
    Hope that helps.

  • How to run the BAPI after creation or Modification ?

    HI Abapers,
    How to run the BAPI after creation or Modification ? What is the step by step procedure to run the the BAPI?
    Immediate reply is highely appriciable.
    Regards,
    Chow.

    Hi
    If you have done with BAPI creation correctly Run it similar to the fun mdule which we run in SE37 calling this BAPi in the program with CALL FUNCTION and passing the necessary parameters
    see the sample bapi code how it is called in Program
    data : w_resb_header like bapirkpfc.
    data: begin of itab_resb occurs 0.
    include structure bapiresbc.
    data: end of itab_resb.
    data: begin of itab_bapi_return occurs 0.
    include structure bapireturn.
    data: end of itab_bapi_return.
    data : w_resb_no like bapirkpfc-res_no.
    w_resb_header-plant = p_werks.
    w_resb_header-res_date = sy-datum.
    w_resb_header-created_by = sy-uname.
    w_resb_header-cost_ctr = '0000010001'.
    w_resb_header-move_type = '201'.
    w_resb_header-gr_rcpt = w_room_time.
    w_resb_header-part_acct = 'OR'.
    *ITEM DATA
    loop at i_details.
    itab_resb-material = i_details-matnr.
    itab_resb-plant = i_details-werks.
    itab_resb-store_loc = i_details-lgort.
    itab_resb-quantity = i_details-qty.
    itab_resb-unit = i_details-meins.
    append itab_resb.
    clear itab_resb.
    clear i_details.
    endloop.
    call function 'BAPI_RESERVATION_CREATE'
    exporting
    reservation_header = w_resb_header
    NO_COMMIT =
    MOVEMENT_AUTO =
    importing
    reservation = w_resb_no
    tables
    reservation_items = itab_resb
    return = itab_bapi_return
    call function 'BAPI_TRANSACTION_COMMIT'
    exporting
    wait = 'X'
    IMPORTING
    RETURN =    .
    wait up to 5 seconds.
    w_resb_no contains your reservations numnber
    Regards
    Anji

  • How to find the number simultaneous call at a given moment on UCCX ?

    Hello,
    I would to know how to find the number simultaneous call at a given moment on UCCX ?
    it's on UCCX or UCCX RTMT, I don't know thanks a lot for your help.
    Aubert

    Hi Gergely,
    I should made a report on the number simultaneous call at a given moment on UCC on the server (all calls on the server)..

  • How to overcome the Memory leakage issue in crystal report 2008 SP2 setup.

    I have developed the small windows based application tool with help of  Visual studio 2008 for identify the memory consumption of crystal report object. It helps to load the crystal report objects in the memory and then released the object from the memory. The tool simply does the u201CLoading and Unloadingu201D the objects in the memory.
    The tool will be started once u201CTest_MemoryConsumption.Exeu201D executed. The u201CTest_MemoryConsumption.Exeu201D consumes u201C9768 KBu201D memory before load the crystal report object in memory. It means, 9768 KB is normal memory consumption for run the tool.
    Crystal report object initiated by the tool and object help to load the report in memory once the tool initiated the crystal report object. Now u201CTest_MemoryConsumption.Exeu201D consumes u201C34980 KBu201D memory during the crystal report object creation and report load process. The actual memory consumption of crystal report object is 34980u20139768=u201C25212u201DKBu201D. 
    The memory consumption u201C34980 KBu201D will be continued till the end of the process. The memory consumption will be reduced to u201C34652 KBu201D from u201C34980 KBu201D once report load process completed. It means, u201C328 KBu201D memory only released from the memory consumption. Tool enables the Release command for the crystal report object. But crystal report object does not respond to the command and will not release his memory consumption.
    The memory consumption u201C34652 KBu201D will be stayed in the memory once job ends.  If i again initiate the crystal report object then it crystal report object start to consume the memory from 34652 KB.
    Database objects and crystal report objects are properly used in the tool. The object release commands properly  communicated to crystal report setup. But the u201CCrystal report service pack 2u201D setup unable to respond the commands which has enabled from .Net Tool.  Crystal report objects are properly initiated and disposed in the tool. But the crystal report unable to release from the server.
    The memory consumption will be reduced once the server restarted or kill the application.
    Crystal report 2008 and crystal report 2008 SP2 setup available in the server.
    Microsoft .Net Framework 2.0 SP2, Microsoft .Net Framework 3.0 SP2 and Microsoft .Net Framework 3.5 SP1 are available in the server,
    Could you please suggesst how to avoid the memory consumption keep increasing and  how to release the memory consumption  once the crystal object disposed???

    Hi Don..
    My case is different one. I hope, the problem with Run time Installation setup file (Crystal report 2008 Serivce Pack2 installer) which we installed in the server.
    Let me explain with Live scenario which our client faced in crystal report 2008 Service pack2 Installer.
    Our client is using a application to help to print their reports. The application is developed with Windows service.
    Windows service keep on running in the server. Windows service executes the client 's crystal reports( Labels Report, Stock  report) which designed for clients need and the reports will be printed from printer. 
    10 Same type report (Label Report) will be printed in 1 minute. Reports are not printing during non business hours. But the windows service keep on running.  Memory cosumption of application will be 160 MB in business hours.
    For Example, On Monday the application memory consumption starts with 160 MB. The Memory consumption will be reached 165 MB  in peak business hours. Then the memory will be ended in163 MB in the End of Monday. It means, The memory consumption will be in 163 MB during the non business hours. Reports will not be printed in non business hours.
    On Tuesday, the application memory consumption starts with 163 MB and it will be reached 168 MB during the peak hours. The Memory consumption will be ended in 165 MB in the end of Tuesday.  The same process contiues till friday. End of friday, the memory consumption of the application will be ended with 170 MB.
    Application Memory Consumption slowly increasing in the server. In 5 days, Memory consumption reached Threshold value (170 MB) of the server. Application gets hanged up once the memory consumption reached 170 MB. We got the error messages as "Attempted to read write protected memory " / "Not Enough memory for process".  If we restart server / If we restart the service then memory consumption of application get reduced to 160 MB.
    From the above scenario, We came know that the either the problem with Application object or the problem crystal report object. In the application, We have checked dispose methods of application objects completly. I am sure that  application objects are properly disposed in the application. I hope the problem not with application objects. The problem with Crystal report objects.
    Application properly communicates the dispose methods to crystal report objects. Crystal report objects are not released from
    the memory.
    Crystal report 2008 Serive Pack 2 setup installed in the server. 
    As you said, If Crystal report runtime is not released from memory then memory consumption keep increase???  In service oriented architecture application, how to unload the crystal report runtime??
    Do you any fix for this kind of issue??
    Willl Crystal report 2008 service pack 3 help on this issue??

Maybe you are looking for

  • Excel ActiveX invoke nodes are broken

    I am using LabVIEW 2007.  We are using a VI that runs on most of the PC's in our facility however on some the "invoke node" related to Excel functions don't operate. They are broken and the VIs won't run.  We get errors that the "Invoke Node: contain

  • Not able to print on Purchase order whatever we fill in item text

    not able to print on Purchase order whatever we fill in item text, from where can we link to get printed item text on purchase order

  • Network Settings / Router Access

    I have an imac and an Addon 3500 wireless router which I use to connect my Xbox360 to broadband In the past if I have had to switch the power off of the iMac I have accessed the router via http://192.168.1.1/ by accessing wireless connection and savi

  • Java or Adobe?

    For the IPad 2, will it allow you to download Java or Adobe to view certain emails that require it? Or am I just out of luck, are certain forwarded emails not going to be able to be read? Thanks in advance.

  • Where is the trash on Lion?

    Hi, This should be easy, but I can't for the life of me find the trash icon after having upgraded to Lion. I used to have it on my desktop and in my sidebar. How can I make the trash visible again? Ben