OutOfMemoryError - good way to handle this error?

Hello.
I am pulling in images into an array, and every now and then I will get an error stating:
OutOfMemoryError
I posted earlier concerning how to examine whether an image can be garbage collected or not, and I got some useful replies.
But, I was wondering if there were any tips on how to handle this error.

In general you cannot handle this error as it is possible that your
error handling code with cause the error again. In reality you
can catch it somewhere where you know a large chunk of memory has been
freed.
matfud

Similar Messages

  • What's a good way to handle this conversion to a QUAN field?

    Good day everyone,
    I developed an RFC that receives data from XI.  I assign this data to a BAPI, and one of the fields is a field with a data type of QUAN(length 13, decimals 3).  All works fine if XI passes me a numeric value in this field.
    Here's the problem:  In running some test cases through XI and into the RFC, we ran a test case where the quantity field had a value of "test" (e.g. no numeric value).  Incredibly, XI transforms the text value of "test" into the value of 4534 and sends it to my RFC.  So my RFC thinks everything's fine when, in fact, that number was derived from a text field and is completely wrong.
    What we need to do is change the field to something that will "kick out" in XI when it tries to call my RFC.  I thought I could change it to a type of NUMC, but that doesn't let me use decimals.  We've already sent out the file layout to vendors, so we expect them to include numeric values with decimal places if need be.
    Is my best bet changing this to a character field with a length of 17, then checking to make sure it consists only of 0-9, a space, or a decimal?  I then need to assign it to the BAPI's field with the data type of QUAN(13,3) -- am I going to have issues trying to do this from a character field?  Do I need to worry whether or not they include a decimal (it might be implied -- in other words, they might just say quantity is "20" which becomes "20.000" to the BAPI).  Is there a nifty routine I can use to do all this easily?
    Thanks everyone.  Points awarded as always for ALL helpful answers.

    Ravi, that's kinda what I was thinking, but if it's true (i.e. a proper amount) can I just move the contents directly to my QUAN field?  Will SAP automatically do the conversion for me such that it ends up in the right place?  I've yet to have to worry about such conversions -- this is the first time I've had to deal with it -- and I want to make sure that the right value gets assigned, whether that value is "20", "54.1", "1000.25", or "986.500".

  • What's the best way to handle this?

    I'm not sure what APIs/setup to use for this situation:
    A company wants to store data projects they do for clients. Each year, the data fields are set (as a result of gov't requirements) and they won't change for any client project for that year. however, the fields required can (and usually do) change every year. So things they require this year, might not be needed the next year and new fields might be introduced.
    While there are likely to be many common fields from year to year, there's no way to guarantee which ones will remain consistent. They also want to be able to do searches on the data and fields, for projects within a year and across years.
    What's the best framework/API/configuration to handle this? EJB? Simple JDBC? If so, how should the database be handled? Won't it have to constantly create new fields in a table? Or is there another way to handle this?
    What's the best way from a "clean architecture" standpoint?

    dang, I really have to start over? I finally got all this stuff working again.  well, hopefully it won't be as big a pain this time since the data won't be coming from a different machine.   After completing the Migration Assistant process, I had to reinput a bunch of serial numbers for apps, reinstall print and mouse drivers, etc...  I've finally got the new machine up and running smoothly and now I gotta start over? Sigh.
    I was hoping that either I could rename the current account after deleting the other one, or just move everything from one account to the other and then delete the 'RJM' account.
    ok, so it sounds like here are the steps I need to take:
    - make another full cloned backup of this current machine in Super Duper
    - reboot this machine using the advice in the first post, wipe everything clean and reinstall the OS
    - create a new account like 'user1' and re-do software update (which is like 2.5 gig worth of stuff) and takes like an hour even on a high speed connection
    - then re-do the migration assistant process to the properly named account
    - then delete the 'user1' account
    does that sound right?

  • Is it good way of using this?

    Hi Experts,
                     Is it using inside loop ,  select single -
    statement,  is it good way of using this during performance? Pls suggest me

    //Is it using inside loop , select single -
    statement, is it good way of using this during performance? Pls suggest me
    See
    loop at itab.
           select single ...
           endloop.
    This is as good as executing the select statement the number of times as the entries in table itab.
    You can use this but when it comes to performance then say suppose 10000 entries are there then select is executed 10000 times .
    If u do a Sql trace ST05 on the code it will show u in minute(s) .
    So if i do a select and read all the entries into an internal table and now compare this with the Read statement then the performance will be high .
    Regards,
    vijay.

  • What's a good way to do this?

    I'm an old C programmer learning Java. As an exercise, I'm writing a
    fairly simple astronomy program, and one of the things it needs to do is
    to convert between two different coordinate systems, (altitude, azimuth)
    and (hour angle, declination).
    As it happens, it's possible to write a single conversion function that
    works in both directions. In C, the prototype might look like
    void convert( double latitude, double fromX, double fromY,
    double toX, double toY );
    and I could call this two different ways.
    convert( lat, alt, az, &ha, &dec );
    convert( lat, hr, dec, &alt, &az );
    Is there an elegant way to implement this in Java? Everything I can
    think of feels kinda kludgy and slow (convert() can easily be called
    millions of times).
    I know I could represent the coordinate pairs as double[] and have
    public static void convert( double lat, double[] from, double[] to )
    but I'm not real happy with that. I'd have to use double[] in the rest
    of the program, which would mean things like
    star[ i ].EqCoord[ 0 ]
    star[ i ].AACoord[ 1 ]
    instead of the more concise and self-documenting
    star[ i ].ha
    star[ i ].az
    Or I could wrap the calls to convert() with something like
    double[] result = new double[ 2 ];
    convert( lat, star[ i ].alt, star[ i ].az, result );
    star[ i ].ha = result[ 0 ];
    star[ i ].dec = result[ 1 ];

    Thanks kglad! I think I'm getting the logic looking at a
    number of examples.
    Would I head in this direction?
    onClipEvent (load) {
    moveTo(ball_mc._x,ball_mc._y);
    _root.onEnterFrame = function(){
    lineTo(ball_mc._x, ball_mc._y);
    lineStyle(3, 0xee3355, 100);
    Or this direction:
    onClipEvent (load) {
    /* x & y co-ordinate for the movieclip code.*/
    x1 = _parent.ball_mc._x;
    y1 = _parent.ball_mc._y;
    moveTo(x1,y1);
    lineStyle(3, 0xee3355, 100);
    onClipEvent (enterFrame) {
    lineTo(_parent.code._x, _parent.code._y);

  • How to handle this error!(please help)

    hey !
    i am getting this error massege(cannot resolve the symbol(setBorder).i am really confused .
    please somebody help me!
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.*;
    import java.text.SimpleDateFormat;
    //import javax.swing.border.CompoundBorder;
    class MyPanel extends Grid
    public MyPanel()
    public MyPanel(String title)
    setBorder(BorderFactory.createCompoundBorder(
    BorderFactory.createTitledBorder(title),
    BorderFactory.createEmptyBorder(5,5,5,5)));
    public class Grid extends JFrame /*implements ActionListener*/
    static final int FPS_INIT = 15; //initial frames per second
    static final int FPS_INIT2=2000;
    //THIS LINE
    //static final double FPS_INIT3=Aug;
    int intframeNumber = 0;
    int delay;
    boolean frozen = false;
    private JPanel date_panel,year_panel, month_panel,day_panel;
    private String time=new String("");
    private Date date=new Date();
    public Grid() {
    time=time + new Date().toString();
    SimpleDateFormat formatter = new SimpleDateFormat("E, MMMM d, yyyy") ;
    time = formatter.format(date) ;
    date_panel=new JPanel();
    year_panel=new JPanel();
    month_panel=new JPanel();
    day_panel=new JPanel();
    JSlider framesPerSecond = new JSlider(JSlider.HORIZONTAL,
    1, 31, FPS_INIT);
    JSlider framesPerSecond2 = new JSlider(JSlider.HORIZONTAL,
    1990, 2010, FPS_INIT2);
    //THIS LINE
    // JSlider framesPerSecond3 = new JSlider(JSlider.HORIZONTAL,
    // Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec, FPS_INIT3);
    date_panel.setLayout(new FlowLayout());
    date_panel.add(new JLabel(time));
    day_panel.setLayout(new FlowLayout());
    day_panel.add(framesPerSecond);
    //year_panel.setLayout(new FlowLayout());
    MyPanel year_panel = new MyPanel("Year");
    year_panel.setLayout(new BorderLayout());
    month_panel.setLayout(new FlowLayout());
    // month_panel.add(framesPerSecond3);
    // JSlider framesPerSecond = new JSlider(JSlider.HORIZONTAL,
    // 0, 31, FPS_INIT);
    // framesPerSecond.addChangeListener(new SliderListener());
    //Turn on labels at major tick marks.
    framesPerSecond.setMajorTickSpacing(5);
    framesPerSecond.setMinorTickSpacing(1);
    framesPerSecond.setPaintTicks(true);
    framesPerSecond.setPaintLabels(true);
    framesPerSecond.setBorder(
    BorderFactory.createEmptyBorder(0,0,10,0));
    framesPerSecond2.setMajorTickSpacing(5);
    framesPerSecond2.setMinorTickSpacing(1);
    framesPerSecond2.setPaintTicks(true);
    framesPerSecond2.setPaintLabels(true);
    framesPerSecond2.setBorder(
    BorderFactory.createEmptyBorder(0,0,10,0));
    year_panel.add(framesPerSecond2);
    /* framesPerSecond3.setMajorTickSpacing(2);
    framesPerSecond3.setMinorTickSpacing(1);
    framesPerSecond3.setPaintTicks(true);
    framesPerSecond3.setPaintLabels(true);
    framesPerSecond3.setBorder(
    BorderFactory.createEmptyBorder(0,0,10,0));*/
    //JPanel contentPane = new JPanel();
    //Create the label for the animation.
    // picture = new JLabel(new ImageIcon("images/doggy/T"
    // + frameNumber
    // + ".gif"),
    // JLabel.CENTER);
    Container contentPane = getContentPane();
    contentPane.setLayout(new GridLayout(4,4));
    contentPane.add(date_panel);
    contentPane.add(year_panel);
    contentPane.add(day_panel);
    // contentPane.add(month_panel);
    public static void main(String args[]) {
    Grid gw = new Grid();
    gw.setTitle("Date Slider");
    gw.setSize(400,200);
    gw.setVisible(true);

    you have to set the border for ur component, u can not call set border on the air..........
    i have changed your code like this
         year_panel.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder(title),BorderFactory.createEmptyBorder(5,5,5,5)));
    and
                                  public JPanel date_panel,year_panel, month_panel,day_panel;
    instead of private i have used public.It is compiling.

  • Best way to handle this producer-consumer situation

    This is, i'm sure a common thing, however, I never really thought about it before. I can't post my VI so a description will have to do. It should go without saying, but I will repeat it's producer-consumer architecture. Let's say you have a signal generator and all the controls for it are in a cluster. A value changes, fires an event in the producer loop and you compare new and old values to determine which button changed. Cool, all good. So then I queue up a read front panel state in my prodcuer loop which is dequeued in my consumer loop. The read front panel state loads all the new values into a cluster which then is fed into a shift register to be accessed from anywhere in my code (see here).
    Now my question is, what should my next state be that I queue up? If I have a single "send commands to sig gen" state, in my consumer loop I again have to determine which value changed in order to know which command to send (because the original determination of what changed was in the producer loop). However, if I have an individual state for each command I want to send, my case structure will get very big, very fast.
    Final option is have one send command state and just write all data on a single control's value change, whether it's new or not (this seems overkill).
    Suggestions please?
    CLA, LabVIEW Versions 2010-2013
    Solved!
    Go to Solution.

    For situations like this I would not send a "state" to the consumer.  I send a "command."   When the consumer receives a command, it determines whether that command is executed immediately or whether it completes the task in process and then handles the new command.
    Along with the command I send a parameter or parameters.  For your signal generator the parameters would probably be something like a cluster of "control ID" and "value."  The control ID would probably be a typedefed enum and the value a DBL.
    What ever you decide, think about it, plan it, and document it before you code it.
    Lynn

  • Collecting Caller Inputs - best way to handle this?

    Greetings,
    My apologies in advance, I'm sure this has been asked before and I did try the search function.
    So we have a need to collect, and report on, caller inputs on a couple of menus. For example - one menu offers three options, and based on your choice you could go to another menu with five options, etc. And we're trying to get a handle on the best way to collect and report on callers inputs at the various levels. We know UCCX comes with ten custom variables however, if we have custom variables doing other things can we reuse them? Or, once they are designated to do something are they no longer available?
    Would it be best to use a log file of some kind/type?
    If there are posts (somewhere) discussing this, a link would be spectacular.
    For those of you who have dealt with this your insights would be appreciated.
    Thanks for your time and attention!

    https://supportforums.cisco.com/thread/2151833?tstart=0

  • I'm using Parallels 7 on an imac with Windows 7.  Both OSX and Windows (and especially quicken on Windows) runs very slow.  Is there a good way to fix this?

    Since installing Parallels 7 and Windows 7 (to use Quicken), my imac and the virtual computer run very slow.  Is there a good fix?

    Start up while holding Command R and run Disk Utility, check the SMART status and repair your hard drive.

  • How do I handle this error message?

    Previously created site with css, html and php pages. All working without issue until today. Now when I open them, try to save them, or close them I get the following message on a popup:
    The following translators were not loaded due to errors: PHP_MySQL.htm: has configuration information that is invalid.
    Dreamweaver CS5.5, Windows

    Try
    http://helpx.adobe.com/dreamweaver/kb/troubleshoot-javascript-errors-dreamweaver-cs4.html (steps #4 and #12)
    http://forums.adobe.com/message/4152143

  • Hey! so i am traveling out of the country. I am extremely confused, if I turn on air plane mode and enable wifi, can i send iMessage without ANY extra charges for being international? Also, what are other good ways to do this and not be charged?

    I really need help! also, if there is any other way i can just use wifi without being charged AT ALL would be great

    iOS: Understanding airplane mode

  • DOWNLOADED THE LATES ITUNES BUT NOW I CAN NOT FIND THE BACKUP  OPTION IN THE LIBRARY. BACK UP TO DVD, SO HOW IS THE BEST WAY TO HANDLE THIS?

    I DOWNLOADED THE LATEST UPDATE TO ITUNES AND NOW CAN NOT FIND HOW TO BACKUP MY LIBRARY

    The backup to disk option was removed as of iTunes 10.4. If you want to back up your tracks to a CD, you can as a workaround put the tracks in a playlist and then use the Burn Playlist to Disk command and select a data disk as the format. If you want to back up your tracks to a DVD now, you'll need to use other software. Unless your library is pretty small, though, it's probably a lot more effective to just copy the entire iTunes folder to an external hard drive or USB flash drive. 
    Regards.
    Forum Tip: It is generally considered inappropriate to type all in uppercase letters in Internet discussions, as text that is typed all in uppercase is by convention considered to be shouting.  Uppercase is also more difficult to read, so please use all uppercase sparingly and only when you really mean to shout, which we hope you won’t need to do here .

  • How to handle runtime error in PreUUT step when running in Parallel mode

    I would like to run Test UUTS in parallel mode, and some actions are done in PreUUT such like read serial number and fixture control.
    The process model won't goto PostUUT Step when runtime error occurs in PreUUT step, so i would like to add some actions to check if sequence error in cleanup and go back to setup in PreUUT step, but i find it skip all the actions in setup and main step?
    What should i do if i want to go back to run PreUUT again as the first time to run when runtime error occurs?
    Or, is there any good way to handle this kind of error withour restart program?
    Solved!
    Go to Solution.

    This question does not depend on PreUUT or ParallelModel at all.
    First of all:
    A Runtime Error is a situation where TestStand encounters a problem which makes further testing either impossible or senseless. So a Runtime Error always indicates a situation where proceeding the test sequence is not recommended.
    Nevertheless, there are situation where you want to handle those errors without stopping the execution. A "traditional example" for this is initialising serial/GPIB devices. If the device does not reply, there might be different issues the operator can easily resolve and (if corrected) the sequence can proceed properly. The operators action could be:
    - Check if device is switched on
    - Check connection between PC and device
    So the error state is used to inform the operator about the malfunctioning device and regarding of the actions the operator takes, the execution will either proceed or terminate.
    When TestStand encounters a Runtime Error, it initially reacts with displaying a dialog. This behavior can be modified in the Station Options >> Preferences >> On Runtime Error.
    Furthermore, you can install callback sequences which are called if an error occurs. Those would be either SequenceFilePostStepRuntimeError or ProcessModelPostStepRuntimeError (depending on the fact if you are changing the process model or simply working with client sequence file callback overrides). These are "normal" sequences you can use in order to get system information, loop on the step or....essentially do whatever you want. If you want to proceed though, you must not forget to reset the error flag.
    hope this helps,
    Norbert 
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Whats a good way switch between a real and mock data service?

    I have a new Flex application...and am contemplating the use of the Mate mock remote object capability.
    However, I'd like the application to be able to switch back and forth between a real and mock data service without recompilation.  And without loading the mock service objects unless they are needed.
    Whats a good way to handle this switching without recompiling the application?

    The only way I can think of not having ANY mock services in the production code is to take them out manually.  Your program for mocking purposes is going to have to be able to know where these services/object are and how to contact them.  I'm sure if it had to be done , you could use some mass of modules and event maps.
    Sincerely ,
      Ubu

  • Is this a good way for loading and handling an xml file?

    I'm new to xml files, but it seems to me that a good way to handle them may be this:
    - create an xmltype table with a unique xmltype column
    - load the xml file in the xmltype column of the table
    - writing a procedure for scanning the whole column of the table by using the extractvalue built-in function for inserting the different nodes of the xml file (just loaded) in the final tables (to link correctly the father and son tags with foreign keys)
    Does it seem to you a good way to load the nodes of a xml file in a relation database?
    Thanks!

    Is this the 10gR2 Express Edition you mentioned over in How to load a XML file into a table or a different version?

Maybe you are looking for

  • Need help: page wont preview in browser properly

    I am stuck designing the layout for this page right now. I'll attach what I have and the sample template that I based it off of. I cant figure out why it seems to display just fine in dreamweaver but when previewing in a browser everything is bunched

  • SSL web service task SOAP header Action was not understood..

    Hi all, While I create  web service task to consum a wcf service using SSL and execute the task it give the following error: But the same WCF service is deployed in nonSSL (basicHTTPBinding) , it works well and the results are received. Could any one

  • Where to download the soure code of Firefox 4.0b2pre?

    We need the source code of Firefox 4.02bpre but it could NOT be found. So provide a proper url from where it can be downloaded.We also tried with CVS commands but found nothing. Thank you!

  • Generating pdfs from Flex

    I'd like to generate pdf files from Flex. How is this done? How much does it cost? How flexible is it?

  • Using WRT610N / WUSB600N with WD TV Live Media Player - please help

     It's quite incredible, but I am so lost here... spent 6 hours with WD and Linksys tech support online... and still no answers.  Running Windows 7 Ultimate (64-bit) with WD TV Live, which has the Linksys WUSB600 dual-band wireless-N USB adapter plugg