Ore program makes my Java Program crash, which uses lots of memory (Urgent

I use a very huge HashMap to calculate something, and the HashMap size
may be increased dynamically.
And I start the program with -Xms300M -Xmx300M (The OS is Win2000).
When I start some programs which may use more memory , My program shows
that the free memory is absolutely enough , but suddenly, The thread to
handle the HashMap seems to be hanged, and the free memory is shown to be
reduced continuously.
At this time, I can't stop the program, Sometimes I can't kill it by the
Task Management Manager.
It seems that my java program is robbed with physical memory, and
encounter memory problem, and can't restore from it?
Would you please tell me how to fix this problem?
Thank you very much!
Sincerely,
Fang Jing
[email protected]

Looks more like an endless loop to me.
Can you post the code where the problem occurs?

Similar Messages

  • Program crashes when using Cwui.ocx controls

    My program (using controls from cwui.ocx) runs without any problems on Polish version of NT (on Win2K also). When I try to create any controls on German version of NT4.0 (SP 6.0a, VS C++ 6.0 with SP 5.0) it crashes imediately. Why? ( of course cwui.ocx was registered in OS using regsrv32).

    Greetings!!!
    Thanks for using the Developer Zone here at National Instruments. We really are proud of this forum and appreciate our customers using it to help one another as well as to talk to us here at NI about what is going on with their applications.
    Right away, I can tell you that Polish and German OSes are not readily available to most of the Application Engineers that field your questions. What I can recommend doing is this: go to www.ni.com/ask and send in an e-mail to one of the engineers here. Include as much information, and maybe even your code, if that is at all possible. If they do not find an immediate solution, which I haven't been able to locate thus far, they will be able to get a hold of the R&D department to see if they can evaluate t
    his issue.
    Off hand, it seems like an OS conflict, but R&D will be able to confirm that for you. So, I would recommend pursuing that route and we will endeavor to get your issue addressed as quickly as possible.
    Thanks again for your support of National Instruments!
    Best Regards,
    Greg Wempe
    National Instruments

  • How to make an apllication in LV7 which using a DLL ?

    My vi application call a DLL, it runs ok offline, I want to make it running
    on a CVS, so how can I include the DLL when making the appliaction.
    thanks.

    My interest is in building a stand-alone application or an exe file. The DLL
    was generated using Visual C++. It works alright off-line. I just want to
    build an exe with the DLL included so I can run it on the CVS or any other
    platform. Do I need to copy the DLL to the CVS? What if the platform does
    not have sufficient storage media?
    "jdigiova" wrote in message
    news:[email protected]..
    > What DLL are you calling? Is this DLL something that you wrote? What
    > programming environment did you make the DLL? Are you getting an
    > error when you download a VI with this DLL? What is happening?
    >
    > In general, a DLL will work in RT if that DLL does not make any
    > unsupported Windows API calls. If you have
    CVI you can develop a DLL
    > using the build option to make it compatible for RT. This will inform
    > you if you are making any unsupported calls.
    >
    > Joe D.
    > National Instruments

  • Firefox crashing after using ~1.3GB memory with many tab

    I'm generally using FF with around ~100 tabs (or more). Whenever FF reaches a certain memory level (somewhere above 1.1GB), it crashes. I have submitted several crash reports, but I didn't get response to any of them. I have upgraded memory from 2GB to 3GB in my computer without any luck. It is terribly annoying to have a crash every so often (every some hour). This is an issue for several months now (don't know when it started, probably like 6 months ago), and it persisted through several FF/Flash upgrades (I don't think it has something to do with Flash though).
    Any ideas? If you need more info, just tell me.
    Thanks,
    Peter

    I'll try it probably later today.
    I didn't have any issues with Chrome so far. Although the multi-process nature of Chrome would probably make the issue non existent.

  • Ever since the systyem upgraded me to 3.6.6. I can not even run one eight hour day without firefoc either crashing or locking up which requires me use C/A/Deleate to close the program. I used to be able to run 8 to 12 windows at a time and NEVER lock up

    Ever since the systyem upgraded me to 3.6.6. I can not even run one eight hour day without firefoc either crashing or locking up which requires me use C/A/Deleate to close the program. I used to be able to run 8 to 12 windows at a time and NEVER lock up or crash with the older version. Is this problem being looked into and or being corrected. I use Firefox with Google and my system is XP Pro 32 bit. THIS IS REALLY making me MAD. My email is [email protected] and would appreciate a response to this ASAP. I have tried a couple of items from your help section and nothing works.

    <u>'''Anonymous'''</u>
    Please post a separate question. Thank you. https://support.mozilla.com/tiki-ask_a_question.php?locale=en-US&forumId=1
    <u>'''chris'''</u>
    <u>'''''Crashing'''''</u>
    See:
    http://support.mozilla.com/en-US/kb/Firefox+crashes
    http://kb.mozillazine.org/Firefox_crashes
    http://support.mozilla.com/en-US/kb/Firefox+crashes+when+loading+certain+pages
    http://support.mozilla.com/en-US/kb/Firefox+crashes+when+you+open+it
    http://support.mozilla.com/en-US/kb/Firefox+will+not+start
    http://kb.mozillazine.org/Browser_will_not_start_up
    ''<u>'''Hanging'''</u>''
    See: http://support.mozilla.com/en-US/kb/Firefox+hangs
    <u>'''''Hanging at exit'''''</u>
    <u>'''Kill Application'''</u>
    In Task Manager, does firefox.exe show in the <u>'''Processes'''</u> tab?
    See: [http://kb.mozillazine.org/Kill_application Kill Application]
    '''<u>Causes and solutions for Firefox hanging at exit:</u>'''
    [[Firefox hangs]]
    [http://kb.mozillazine.org/Firefox_hangs#Hang_at_exit Firefox hangs at exit]
    [[Firefox is already running but is not responding]]
    ''<u>'''Safe Mode'''</u>''
    You may need to use '''[[Safe Mode]]''' (click on "Safe Mode" and read) to localize the problem. Firefox Safe Mode is a diagnostic mode that disables Extensions and some other features of Firefox. If you are using a theme, switch to the DEFAULT theme: Tools > Add-ons > Themes <u>'''before'''</u> starting Safe Mode. When entering Safe Mode, do not check any items on the entry window, just click "Continue in Safe Mode". Test to see if the problem you are experiencing is corrected.
    See:
    '''[[Troubleshooting extensions and themes]]'''
    '''[[Troubleshooting plugins]]'''
    '''[[Basic Troubleshooting]]'''
    If the problem does not occur in Safe-mode then disable all of your Extensions and Plug-ins and then try to find which is causing it by enabling <u>'''one at a time'''</u> until the problem reappears. <u>'''You MUST close and restart Firefox after EACH change'''</u> via File > Restart Firefox (on Mac: Firefox > Quit). You can use "Disable all add-ons" on the Safe mode start window.
    <u>'''chris'''</u>
    <u>'''''Other Issues'''''</u>: ~~red:You have installed plug-ins with known security issues. You should update them immediately.~~
    <u>'''Update Java'''</u>: your ver. 1.6.0.~~red:17~~; current ver. 1.6.0.20 (<u>important security update 04-15-2010</u>)
    (Firefox 3.6 and above requires Java 1.6.0.10 or higher; see: http://support.mozilla.com/en-US/kb/Java-related+issues#Java_does_not_work_in_Firefox_3_6 )
    ''(Windows users: Do the manual update; very easy.)''
    ~~red:Check your version here~~: http://www.mozilla.com/en-US/plugincheck/
    See: '''[http://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox#Updates Updating Java]'''
    Do the update with Firefox closed.
    <u>'''NOTE:'''</u> Java version 1.6.0.21 has been released. It is mainly an update for developers of Java applications and most users do not need to be concerned about downloading version 1.6.0.21. <u>'''''At this time'''''</u>, the update option in existing installations of Java 1.6.0.20 are not updating to version 1.6.0.21; <u>'''''at this time'''''</u>, it must be manually downloaded and installed. According to the Java release notes:
    ''"'''Bug Fixes'''''
    ''Java SE 6 Update 21 does not contain any additional fixes for security vulnerabilities to its previous release, Java SE 6 Update 20. Users who have Java SE 6 Update 20 have the latest security fixes and do not need to upgrade to this release to be current on security fixes."'' Source: http://java.sun.com/javase/6/webnotes/6u21.html
    <u>'''Install/Update Adobe Flash Player for Firefox (aka Shockwave Flash)'''</u>: your ver. 10.0 r~~red:45~~; current ver. 10.1 r53 ('''important security update 2010-06-10'''; see: http://www.adobe.com/support/security/bulletins/apsb10-14.html)
    ~~red:Check your version here~~: http://www.mozilla.com/en-US/plugincheck/
    See: '''[http://support.mozilla.com/en-US/kb/Managing+the+Flash+plugin#Updating_Flash Updating Flash]'''
    -'''<u>use Firefox to download</u>''' and <u>'''SAVE to your hard drive'''</u> (save to Desktop for easy access)
    -exit Firefox (File > Exit)
    -''<u>In Windows,</u>'' check to see that Firefox is completely closed (''Ctrl+Alt+Del, choose Task Manager, click Processes tab, if "firefox.exe" is on the list, right-click "firefox.exe" and choose End process, close the Task Manager window'')
    -''<u>In Windows,</u>'' double-click on the Adobe Flash installer you just downloaded to install/update Adobe Flash
    -when the Flash installation is complete, start Firefox, and test the Flash installation here: http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_15507&sliceId=1
    *<u>'''NOTE: On Vista and Windows 7'''</u> you may need to run the plugin installer as Administrator by starting the installer via the right-click context menu if you do not get an UAC prompt to ask for permission to continue (i.e nothing seems to happen). See this: http://vistasupport.mvps.org/run_as_administrator.htm
    *'''<u>NOTE for IE:</u>''' Firefox and most other browsers use a Plugin. IE uses an ActiveX version of Flash. To install/update the IE ActiveX Adobe Flash Player, same instructions as above, except use IE to download the ActiveX Flash installer. See: [[ActiveX]]
    *Also see: http://kb.mozillazine.org/Flash ~~red:'''''AND'''''~~ [[How do I edit options to add Adobe to the list of allowed sites]]
    <u>'''Update Shockwave for Director (aka Shockwave Player)'''</u>: your ver. ~~red:10.1 (very old)~~; current ver. 11.5.7.609 (<u>important security update released 2010-05-11</u>; see http://www.adobe.com/support/security/bulletins/apsb10-12.html)
    NOTE: this is not the same as Shockwave Flash; this installs the Shockwave Player.
    ~~red:Check your version here~~: http://www.mozilla.com/en-US/plugincheck/
    SAVE the installer to your hard drive (Desktop is a good place so you can find it). When the download is complete, exit Firefox (File > Exit), locate and double-click in the installer you just downloaded, let the install complete.
    See: '''[http://support.mozilla.com/en-US/kb/Using+the+Shockwave+plugin+with+Firefox#_Installing_Shockwave Installing Shockwave]'''
    <u>'''You '''</u>~~red:<u>'''MAY'''</u>~~<u>''' need to Update Adobe Reader for Firefox (aka Adobe PDF Plug-In For Firefox)'''</u>: your ver. N/A; current ver. 9.3.3 (important security update release 06-29-2010; see: http://www.adobe.com/support/security/bulletins/apsb10-15.html)
    ~~red:Check your version here~~: http://www.mozilla.com/en-US/plugincheck/
    See: http://support.mozilla.com/en-US/kb/Using+the+Adobe+Reader+plugin+with+Firefox#Installing_and_updating_Adobe_Reader
    ''<u>You may be able to update from the Adobe Reader installed on your system</u>'' instead of going to the Adobe site and downloading. Open the Adobe Reader installed on your system (''in Windows, Start > Program Files, find and click Adobe Reader to open''), click Help, click Check for Updates.
    ''<u>If you go to the Adobe site to download the current Adobe Reader:</u>''
    -'''<u>use Firefox to download</u>''' and <u>'''SAVE to your hard drive'''</u> (save to Desktop for easy access)
    ~~red:-See the images at the bottom left of this post to see the steps to take on the Adobe site~~
    -exit Firefox (File > Exit)
    -In Windows: check to see that Firefox is completely closed (''Ctrl+Alt+Del, choose Task Manager, click Processes tab, if "firefox.exe" is on the list, right-click "firefox.exe" and choose End process, close the Task Manager window'')
    -In Windows: double-click on the Adobe Reader installer you just downloaded to install/update Adobe Reader
    *<u>'''NOTE: On Vista and Windows 7'''</u> you may need to run the plugin installer as Administrator by starting the installer via the right-click context menu if you do not get an UAC prompt to ask for permission to continue (i.e nothing seems to happen). See this: http://vistasupport.mvps.org/run_as_administrator.htm
    *'''<u>NOTE for IE:</u>''' Firefox and most other browsers use a Plugin. IE uses an ActiveX version. To install/update the IE ActiveX version, same instructions as above, except use IE to download the ActiveX installer. See: [[ActiveX]]
    *Also see: http://kb.mozillazine.org/Adobe_Reader ~~red:'''''AND'''''~~ [[How do I edit options to add Adobe to the list of allowed sites]]

  • How to make a Java program that recognises a function of two variables...

    How to make a Java program that recognises a function of two variables to assign values to that?
    First I will give an example and then do the question.
    Ex1.
    We have any function, eg.y = x ^ 2 + 1 (read 'y' equals 'x' high to the square), a function of the second degree.
    To build the graph of this function attach values to 'x' to find the values of 'y'
    And thus mount the pair ordered (x, y) which represents a point on the Cartesian plane.
    Assigning values to 'x' 'we can build up a table that gives us the pairs ordered:
    We can use any numbers, but arfer interval [-3.3]
    X | y = x ^ 2 + 1
    -3 | Y = (-3) ^ 2 +1 = 10
    -2 | Y = (-2) ^ 2 +1 = 5
    -1 | Y = (-1) ^ 2 +1 = 2
    0 | y = (0) ^ 2 +1 = 1
    1 | y = (1) ^ 2 +1 = 2
    2 | y = (2) ^ 2 +1 = 5
    3 | y = (3) ^ 2 +1 = 10
    We then ordered the pairs:
    (-3.10), (-2.5); (-1.2), (0,1), (1,2), (2,5), (3,10)
    Tabem that can be represented by a table:
    X | y
    -3 | Y = 10
    -2 | Y = 5
    -1 | Y = 2
    0 | y = 1
    1 | y = 2
    2 | y = 5
    3 | y = 10
    Now I begin to explain my doubts.
    See this program:
    Ex2
    * To change this template, choose Tools | Templates
    * And open the template in the editor.
    Encontrando_o_valor_de_y package;
    * @ Author des Soldat Gottes
    Import javax.swing.JOptionPane;
    Public class (Main
    * @ Param args the command line arguments
    Public static void main (String [] args) (
    Int x, y;
    String x1;
    X1 = JOptionPane.showInputDialog ( "We have the function y = x + 1 \ n" +
    "Assign a value for 'x',"); / / receives a value for the function y = x + 1
    X = Integer.parseInt (x1); / / tranforma String in int
    Y = x + 1; / / receives the value of 'x' and calculates' y '
    JOptionPane.showMessageDialog (null, "The value of 'y' is: \ t \ t" + y);
    / / Displays the value of 'y'
    System.exit (0);
    We see that the program receives above a value for 'x' and replaces the function contained in the program, y = x + 1, and so is the value of the variable 'y'.
    In: x1 = JOptionPane.showInputDialog ( "We have the function y = x + 1 \ n" +
    "Assign a value for 'x',");
    The entry is a number and that number is assigned aa ja existing function in the (y = x + 1).
    The question is: would it be possible to come to a function?
    Ex: the program ask: DIGITE THE FUNCTION?
    The USUARIO DIGITARIA A FUNCTION ANY, TYPE: y = x ^ 2 +1
    The program would recognize the function and give numerical values to that function as Ex1, at the beginning of this text.
    And then to find the values of the x and y launch a table.
    It would be possible that?
    By invez of entering with a number so that the program sustitua a function ja existing as Ex2, seen above, entering with a function quaquer (type: y = x ^ 2 +1) for the program atribuisse values to that function and then create a table of values as Ex1.
    I hope it has been easier to understand my doubts now.
    Thank you for your attention!
    God bless!

    rafaelmenezes wrote:
    Thanks for the explanation, could understand what fly said.
    But as it applied to a program?
    How to create a program that recognizes that the entry coefficients?Are you asking about how to parse out the coefficients from the string "3x^4 + 4x^3 - 8x^2 + 5x^1 + 2x^0"? If you define the format to strictly follow that example, this should get you started:
    Strip out the spaces
    Split the String on "x^"
    That should give you [3, 4+4, 3-8, 2+5, 1+2, 0]
    Split each resulting String on "+ | -", preserving the operator as a token so you can apply the correct sign to the coeff.
    That should leave you with [3, 4, +, 4, 3, -, 8, 2, +, 5, 1, +, 2, 0]. Every other number is a coeff, the rest are the degrees.
    You can strip out the +, since those coeffs are already positive, and strip out the - after negating the following number. This is all assuming that you have to write this yourself. There is no doubt already a library or 5 out there that does this for you.

  • How to make a java program, that can be used by c++ application

    I'm developing a Java web application (WEBapp), but I have also a c++ program.
    C++ program must use WEBapp method to communicate on the web.
    How to make a Java public function that accept value, elaborate, then return the resul to c++ application?

    jschell wrote:
    You have C code.
    You have Java code.
    The two must communicate.I have a c++ program, and a Java program.
    C++ program wants to communicate on the web (send text), and I'm trying to add this functionality to it creating a Java program.
    NOW THE PROBLEM? How c++ program can use java-program (in local) to send data on the web?
    You can just JNI to communicate either from java to C++ or from C++ to java. That is direct communication in that there is a single process involved. Thus you will no longer have a java application and a C++ application but rather a single application.I don't know JNI, i found http://java.sun.com/docs/books/jni/ and I think is too difficult to implement?
    You can use files or sockets to communicate. Using sockets allows for any number of additional protocols including the previously mentioned web services. Those methodologies would allow more than one application to exist.I developed yesterday a java-side-interface using socket (in local host 127.0.0.1). So the c++ program must write or read to/from the socket to comunicate to java (then the java program send data on the web).
    Finally it might be the case that you have a C++ application which you cannot modify. In that case then you MUST use whatever input/output mechanism that it supports. There is no choice. And until you have fully determined what those mechanisms are it is pointless to discuss a solution.I can modify the application, but I don't have developed it. The c++ application use a third-part dll (taken from SKYPE) to comunicate on the web: I have to remove the dipendence from this dll, and add the java program: java program must substitute the dll. It must be non-invasive to the c++ program. DLL calls can be "send(data)" or "receive(data)" or similar.
    For this do you think that JNI is a must, or I can use soket on local host?

  • You sent the iphone 4s in Italy with the program 'Syrians', which is beautiful but you put the Italian language nn .. nn is normal .. how to make even the Italian language ..

    you sent the iphone 4s in Italy with the program 'Syrians', which is beautiful but you put the Italian language nn .. nn is normal .. how to make even the Italian language ..

    you sent the iphone 4s in Italy with the program 'Syrians', which is beautiful but you put the Italian language nn .. nn is normal .. how to make even the Italian language ..

  • Make a Java program call another program??

    Is there a way to make a Java program execute another program?

    Why dont we demonstrate:
    Program (Windows-based) Calculator.exe
    Code:
    try {
    Runtime.getRuntime().exec("c:/windows/calc.exe");
    } catch(IOException e) {}

  • Which Java program do I use for this game?

    Okay, I'm programming a video game for my High School grad project.
    Now, I'm just wondering, which Java program do I use for it? It will be 2-d, I'd like it to have SNES like graphics, and it will be a platformer, but kind of like Metroid. You will be able to change forms, from ice to water to a gaseous state, and you have different powers according to which form you're in, like forming an ice bridge in ice form, slipping through cracks in water form, and rising higher in a gaseous form.
    Thank you for your help.

    no, not if you did not code java before.
    There are IDEs like Eclipse arround but that are not good at beginning because they are quite complex and don't take away the coding.
    lg Clemens

  • Structure Changes in Database make SDK program crash.

    Hi, is there an event I can catch when the database gets a structure change? Say a new table or field added?. Becuase everytime this happens the program crashes.
    Thanks.
    Jose.

    Sorry I didnt specify it was in DI
    I testit it and added a field to a MarketingDocument and after that the program halted in this line of code:
    SAPbobsCOM.StockTransfer _oTraspaso = (SAPbobsCOM.StockTransfer)Global.COMPANY.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oStockTransfer);
    I dont understand the error, it says:
    Exception from HRESULT: 0xFFFFFB9E
    Thank you.

  • Is there any java API throgh which My program can get harddisk,cpu ID adres

    hello
    Is there any java api throuh which i can get hard disk and processor serial numbers.
    i have already use
    process p=Runtime.getTime().exec("cmd command");
    please other than this send any java api, progamming technique that remain same on all plate forms
    advance thanks
    best regards

    >
    Is there any java api throuh which i can get hard disk and processor serial numbers.
    i have already use ..>1) What business is that information to your app.? Or to put that another way. Why do you want to know?
    2) Those words are 'Java', 'API' and 'I' (which is always upper case).
    3) One upper case letter should be used at the start of each sentence, not just once at the start of a post.

  • Program Crashing at sqlite3_Prepare help!!!!

    Hi guys,
    I am trying to make a program which inserts values into a sqlite database. For some reason my program crashes every time I press the button to insert the value. I have been trying to fix this for a long time but have not been able to fix it. Can you please have a look at my code and tell me what's wrong. Im going to put the code of my .m files on here.
    BpValue.m
    #import "BpValue.h"
    static sqlite3 *database = nil;
    static sqlite3_stmt *addStmt = nil;
    @implementation BpValue
    @synthesize valueID, value, isDirty, isDetailViewHydrated;
    + (void) finalizeStatements {
    if(database) sqlite3_close(database);
    if (addStmt) sqlite3_finalize(addStmt);
    - (id) initWithPrimaryKey:(NSInteger) pk {
    [super init];
    valueID = pk;
    isDetailViewHydrated = NO;
    return self;
    - (void) addValue {
    if(addStmt == nil) {
    const char *sql = "insert into BPressure(Value) Values(?)";
    if(sqlite3preparev2(database, sql, -1, &addStmt, NULL) != SQLITE_OK)
    NSAssert1(0, @"Error while creating add statement. '%s'", sqlite3_errmsg(database));
    sqlite3binddouble(addStmt, 1, [value doubleValue]);
    if(SQLITE_DONE != sqlite3_step(addStmt))
    NSAssert1(0, @"Error while inserting data. '%s'", sqlite3_errmsg(database));
    else
    //SQLite provides a method to get the last primary key inserted by using sqlite3last_insertrowid
    valueID = sqlite3last_insertrowid(database);
    //Reset the add statement.
    sqlite3_reset(addStmt);
    - (void) dealloc {
    [value release];
    [super dealloc];
    @end
    MyViewController.m
    #import "MyViewController.h"
    #import "HelloWorldAppDelegate.h"
    #import "sqlite3.h"
    #import "BpValue.h"
    @implementation MyViewController
    @synthesize textField;
    @synthesize label;
    @synthesize string;
    - (IBAction)changeGreeting:(id)sender {
    HelloWorldAppDelegate *appDelegate = (HelloWorldAppDelegate *)[[UIApplication sharedApplication] delegate];
    BpValue *bpObj = [[BpValue alloc] initWithPrimaryKey:0];
    NSDecimalNumber *temp = [[NSDecimalNumber alloc] initWithString:textField.text];
    bpObj.value = temp;
    [temp release];
    self.string = textField.text;
    NSString *nameString = string;
    if ([nameString length] == 0) {
    nameString = @"World";
    NSString *greeting = [[NSString alloc] initWithFormat:@"Hello, %@!", nameString];
    label.text = greeting;
    //Add the object
    [appDelegate addValue:bpObj];
    [greeting release];
    - (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
    if (theTextField == textField) {
    [textField resignFirstResponder];
    return YES;
    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
    // Initialization code
    return self;
    Implement loadView if you want to create a view hierarchy programmatically
    - (void)loadView {
    If you need to do additional setup after loading the view, override viewDidLoad.
    - (void)viewDidLoad {
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
    - (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
    // Release anything that's not essential, such as cached data
    - (void)dealloc {
    [super dealloc];
    [label release];
    [string release];
    [super dealloc];
    @end
    HelloWorldAppDelegate.m
    #import "MyViewController.h"
    #import "HelloWorldAppDelegate.h"
    #import "BpValue.h"
    @implementation HelloWorldAppDelegate
    @synthesize window;
    @synthesize myViewController;
    @synthesize valuesArray;
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    //Copy database to the user's phone if needed.
    [self copyDatabaseIfNeeded];
    NSMutableArray *tempArray = [[NSMutableArray alloc] init];
    self.valuesArray = tempArray;
    [tempArray release];
    MyViewController *aViewController = [[MyViewController alloc]
    initWithNibName:@"ControllerView" bundle:[NSBundle mainBundle]];
    self.myViewController = aViewController;
    [aViewController release];
    UIView *controllersView = [myViewController view];
    [window addSubview:controllersView];
    [window makeKeyAndVisible];
    - (void)applicationWillTerminate:(UIApplication *)application {
    // Save data if appropriate
    //Save all the dirty coffee objects and free memory.
    [self.valuesArray makeObjectsPerformSelector:@selector(saveAllData)];
    [BpValue finalizeStatements];
    - (void)dealloc {
    [valuesArray release];
    [myViewController release];
    [window release];
    [super dealloc];
    - (void) copyDatabaseIfNeeded {
    //Using NSFileManager we can perform many file system operations.
    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSError *error;
    NSString *dbPath = [self getDBPath];
    BOOL success = [fileManager fileExistsAtPath:dbPath];
    if(!success) {
    NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Database.sqlite"];
    success = [fileManager copyItemAtPath:defaultDBPath toPath:dbPath error:&error];
    if (!success)
    NSAssert1(0, @"Failed to create writable database file with message '%@'.", [error localizedDescription]);
    - (NSString *) getDBPath {
    //Search for standard documents using NSSearchPathForDirectoriesInDomains
    //First Param = Searching the documents directory
    //Second Param = Searching the Users directory and not the System
    //Expand any tildes and identify home directories.
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, YES);
    NSString *documentsDir = [paths objectAtIndex:0];
    return [documentsDir stringByAppendingPathComponent:@"Database.sqlite"];
    - (void) addValue:(BpValue *)bpObj {
    //Add it to the database.
    [bpObj addValue];
    //Add it to the coffee array.
    [valuesArray addObject:bpObj];
    @end
    Please if someone knows whats wrong, please tell me. It crashes at sqlite_prepare3. Following is part of the crash report
    Exception Type: EXCBADACCESS (SIGBUS)
    Exception Codes: KERNPROTECTIONFAILURE at 0x0000000000000030
    Crashed Thread: 0
    Application Specific Information:
    iPhone Simulator 1.0 (70), iPhone OS 2.0 (5A345)
    Thread 0 Crashed:
    0 libsqlite3.0.dylib 0x93d211f0 sqlite3Prepare + 48
    1 HelloWorld 0x000031c8 -BpValue addValue + 89 (BpValue.m:38)
    2 HelloWorld 0x00002b70 -HelloWorldAppDelegate addValue: + 36 (HelloWorldAppDelegate.m:84)
    3 HelloWorld 0x00002e6b -MyViewController changeGreeting: + 509 (MyViewController.m:41)
    4 UIKit 0x30a5e25e -UIApplication sendAction:to:from:forEvent: + 116
    5 UIKit 0x30abb022 -UIControl sendAction:to:forEvent: + 67
    6 UIKit 0x30abb4ea -UIControl(Internal) _sendActionsForEvents:withEvent: + 478
    7 UIKit 0x30aba830 -UIControl touchesEnded:withEvent: + 483
    8 UIKit 0x30a75c0b -UIWindow sendEvent: + 454
    9 UIKit 0x30a65e07 -UIApplication sendEvent: + 269
    10 UIKit 0x30a6522a _UIApplicationHandleEvent + 4407
    11 GraphicsServices 0x31699522 SendEvent + 35
    12 GraphicsServices 0x3169b88c PurpleEventTimerCallBack + 276
    13 com.apple.CoreFoundation 0x971be615 CFRunLoopRunSpecific + 3141
    14 com.apple.CoreFoundation 0x971becf8 CFRunLoopRunInMode + 88
    15 GraphicsServices 0x31699d38 GSEventRunModal + 217
    16 GraphicsServices 0x31699dfd GSEventRun + 115
    17 UIKit 0x30a5dadb -UIApplication _run + 440
    18 UIKit 0x30a68ce4 UIApplicationMain + 1258
    19 HelloWorld 0x00002650 main + 102 (main.m:14)
    20 HelloWorld 0x000025be start + 54
    Thread 1:
    0 libSystem.B.dylib 0x93b624a6 machmsgtrap + 10
    1 libSystem.B.dylib 0x93b69c9c mach_msg + 72
    2 com.apple.CoreFoundation 0x971be0ce CFRunLoopRunSpecific + 1790
    3 com.apple.CoreFoundation 0x971becf8 CFRunLoopRunInMode + 88
    4 WebCore 0x32a8a450 RunWebThread + 384
    5 libSystem.B.dylib 0x93b936f5 pthreadstart + 321
    6 libSystem.B.dylib 0x93b935b2 thread_start + 34
    Thread 2:
    0 libSystem.B.dylib 0x93b624a6 machmsgtrap + 10
    1 libSystem.B.dylib 0x93b69c9c mach_msg + 72
    2 GraphicsServices 0x3169ce0a EventReceiveThread + 467
    3 libSystem.B.dylib 0x93b936f5 pthreadstart + 321
    4 libSystem.B.dylib 0x93b935b2 thread_start + 34
    Thread 3:
    0 libSystem.B.dylib 0x93b624a6 machmsgtrap + 10
    1 libSystem.B.dylib 0x93b69c9c mach_msg + 72
    2 com.apple.CoreFoundation 0x971be0ce CFRunLoopRunSpecific + 1790
    3 com.apple.CoreFoundation 0x971becf8 CFRunLoopRunInMode + 88
    4 com.apple.CFNetwork 0x95a59a32 CFURLCacheWorkerThread(void*) + 396
    5 libSystem.B.dylib 0x93b936f5 pthreadstart + 321
    6 libSystem.B.dylib 0x93b935b2 thread_start + 34
    Thread 0 crashed with X86 Thread State (32-bit):
    eax: 0x000040b0 ebx: 0x0000317d ecx: 0xffffffff edx: 0x00003e18
    edi: 0x00000000 esi: 0x004123a0 ebp: 0xbfffe5c8 esp: 0xbfffe470
    ss: 0x0000001f efl: 0x00010282 eip: 0x93d211f0 cs: 0x00000017
    ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
    cr2: 0x00000030

    thanks realized that soon after posting...everything works now yay!!

  • Program Crashing at sqlite_prepare3 help!!!!

    Hi guys,
    I am trying to make a program which inserts values into a sqlite database. For some reason my program crashes every time I press the button to insert the value. I have been trying to fix this for a long time but have not been able to fix it. Can you please have a look at my code and tell me what's wrong. Im going to put the code of my .m files on here.
    BpValue.m
    #import "BpValue.h"
    static sqlite3 *database = nil;
    static sqlite3_stmt *addStmt = nil;
    @implementation BpValue
    @synthesize valueID, value, isDirty, isDetailViewHydrated;
    + (void) finalizeStatements {
    if(database) sqlite3_close(database);
    if (addStmt) sqlite3_finalize(addStmt);
    - (id) initWithPrimaryKey:(NSInteger) pk {
    [super init];
    valueID = pk;
    isDetailViewHydrated = NO;
    return self;
    - (void) addValue {
    if(addStmt == nil) {
    const char *sql = "insert into BPressure(Value) Values(?)";
    if(sqlite3preparev2(database, sql, -1, &addStmt, NULL) != SQLITE_OK)
    NSAssert1(0, @"Error while creating add statement. '%s'", sqlite3_errmsg(database));
    sqlite3binddouble(addStmt, 1, [value doubleValue]);
    if(SQLITE_DONE != sqlite3_step(addStmt))
    NSAssert1(0, @"Error while inserting data. '%s'", sqlite3_errmsg(database));
    else
    //SQLite provides a method to get the last primary key inserted by using sqlite3last_insertrowid
    valueID = sqlite3last_insertrowid(database);
    //Reset the add statement.
    sqlite3_reset(addStmt);
    - (void) dealloc {
    [value release];
    [super dealloc];
    @end
    MyViewController.m
    #import "MyViewController.h"
    #import "HelloWorldAppDelegate.h"
    #import "sqlite3.h"
    #import "BpValue.h"
    @implementation MyViewController
    @synthesize textField;
    @synthesize label;
    @synthesize string;
    - (IBAction)changeGreeting:(id)sender {
    HelloWorldAppDelegate *appDelegate = (HelloWorldAppDelegate *)[[UIApplication sharedApplication] delegate];
    BpValue *bpObj = [[BpValue alloc] initWithPrimaryKey:0];
    NSDecimalNumber *temp = [[NSDecimalNumber alloc] initWithString:textField.text];
    bpObj.value = temp;
    [temp release];
    self.string = textField.text;
    NSString *nameString = string;
    if ([nameString length] == 0) {
    nameString = @"World";
    NSString *greeting = [[NSString alloc] initWithFormat:@"Hello, %@!", nameString];
    label.text = greeting;
    //Add the object
    [appDelegate addValue:bpObj];
    [greeting release];
    - (BOOL)textFieldShouldReturn:(UITextField *)theTextField {
    if (theTextField == textField) {
    [textField resignFirstResponder];
    return YES;
    - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    if (self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]) {
    // Initialization code
    return self;
    Implement loadView if you want to create a view hierarchy programmatically
    - (void)loadView {
    If you need to do additional setup after loading the view, override viewDidLoad.
    - (void)viewDidLoad {
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
    - (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
    // Release anything that's not essential, such as cached data
    - (void)dealloc {
    [super dealloc];
    [label release];
    [string release];
    [super dealloc];
    @end
    HelloWorldAppDelegate.m
    #import "MyViewController.h"
    #import "HelloWorldAppDelegate.h"
    #import "BpValue.h"
    @implementation HelloWorldAppDelegate
    @synthesize window;
    @synthesize myViewController;
    @synthesize valuesArray;
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    //Copy database to the user's phone if needed.
    [self copyDatabaseIfNeeded];
    NSMutableArray *tempArray = [[NSMutableArray alloc] init];
    self.valuesArray = tempArray;
    [tempArray release];
    MyViewController *aViewController = [[MyViewController alloc]
    initWithNibName:@"ControllerView" bundle:[NSBundle mainBundle]];
    self.myViewController = aViewController;
    [aViewController release];
    UIView *controllersView = [myViewController view];
    [window addSubview:controllersView];
    [window makeKeyAndVisible];
    - (void)applicationWillTerminate:(UIApplication *)application {
    // Save data if appropriate
    //Save all the dirty coffee objects and free memory.
    [self.valuesArray makeObjectsPerformSelector:@selector(saveAllData)];
    [BpValue finalizeStatements];
    - (void)dealloc {
    [valuesArray release];
    [myViewController release];
    [window release];
    [super dealloc];
    - (void) copyDatabaseIfNeeded {
    //Using NSFileManager we can perform many file system operations.
    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSError *error;
    NSString *dbPath = [self getDBPath];
    BOOL success = [fileManager fileExistsAtPath:dbPath];
    if(!success) {
    NSString *defaultDBPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Database.sqlite"];
    success = [fileManager copyItemAtPath:defaultDBPath toPath:dbPath error:&error];
    if (!success)
    NSAssert1(0, @"Failed to create writable database file with message '%@'.", [error localizedDescription]);
    - (NSString *) getDBPath {
    //Search for standard documents using NSSearchPathForDirectoriesInDomains
    //First Param = Searching the documents directory
    //Second Param = Searching the Users directory and not the System
    //Expand any tildes and identify home directories.
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, YES);
    NSString *documentsDir = [paths objectAtIndex:0];
    return [documentsDir stringByAppendingPathComponent:@"Database.sqlite"];
    - (void) addValue:(BpValue *)bpObj {
    //Add it to the database.
    [bpObj addValue];
    //Add it to the coffee array.
    [valuesArray addObject:bpObj];
    @end
    Please if someone knows whats wrong, please tell me. It crashes at sqlite_prepare3. Following is part of the crash report
    Exception Type: EXCBADACCESS (SIGBUS)
    Exception Codes: KERNPROTECTIONFAILURE at 0x0000000000000030
    Crashed Thread: 0
    Application Specific Information:
    iPhone Simulator 1.0 (70), iPhone OS 2.0 (5A345)
    Thread 0 Crashed:
    0 libsqlite3.0.dylib 0x93d211f0 sqlite3Prepare + 48
    1 HelloWorld 0x000031c8 -[BpValue addValue] + 89 (BpValue.m:38)
    2 HelloWorld 0x00002b70 -[HelloWorldAppDelegate addValue:] + 36 (HelloWorldAppDelegate.m:84)
    3 HelloWorld 0x00002e6b -[MyViewController changeGreeting:] + 509 (MyViewController.m:41)
    4 UIKit 0x30a5e25e -[UIApplication sendAction:to:from:forEvent:] + 116
    5 UIKit 0x30abb022 -[UIControl sendAction:to:forEvent:] + 67
    6 UIKit 0x30abb4ea -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 478
    7 UIKit 0x30aba830 -[UIControl touchesEnded:withEvent:] + 483
    8 UIKit 0x30a75c0b -[UIWindow sendEvent:] + 454
    9 UIKit 0x30a65e07 -[UIApplication sendEvent:] + 269
    10 UIKit 0x30a6522a _UIApplicationHandleEvent + 4407
    11 GraphicsServices 0x31699522 SendEvent + 35
    12 GraphicsServices 0x3169b88c PurpleEventTimerCallBack + 276
    13 com.apple.CoreFoundation 0x971be615 CFRunLoopRunSpecific + 3141
    14 com.apple.CoreFoundation 0x971becf8 CFRunLoopRunInMode + 88
    15 GraphicsServices 0x31699d38 GSEventRunModal + 217
    16 GraphicsServices 0x31699dfd GSEventRun + 115
    17 UIKit 0x30a5dadb -[UIApplication _run] + 440
    18 UIKit 0x30a68ce4 UIApplicationMain + 1258
    19 HelloWorld 0x00002650 main + 102 (main.m:14)
    20 HelloWorld 0x000025be start + 54
    Thread 1:
    0 libSystem.B.dylib 0x93b624a6 machmsgtrap + 10
    1 libSystem.B.dylib 0x93b69c9c mach_msg + 72
    2 com.apple.CoreFoundation 0x971be0ce CFRunLoopRunSpecific + 1790
    3 com.apple.CoreFoundation 0x971becf8 CFRunLoopRunInMode + 88
    4 WebCore 0x32a8a450 RunWebThread + 384
    5 libSystem.B.dylib 0x93b936f5 pthreadstart + 321
    6 libSystem.B.dylib 0x93b935b2 thread_start + 34
    Thread 2:
    0 libSystem.B.dylib 0x93b624a6 machmsgtrap + 10
    1 libSystem.B.dylib 0x93b69c9c mach_msg + 72
    2 GraphicsServices 0x3169ce0a EventReceiveThread + 467
    3 libSystem.B.dylib 0x93b936f5 pthreadstart + 321
    4 libSystem.B.dylib 0x93b935b2 thread_start + 34
    Thread 3:
    0 libSystem.B.dylib 0x93b624a6 machmsgtrap + 10
    1 libSystem.B.dylib 0x93b69c9c mach_msg + 72
    2 com.apple.CoreFoundation 0x971be0ce CFRunLoopRunSpecific + 1790
    3 com.apple.CoreFoundation 0x971becf8 CFRunLoopRunInMode + 88
    4 com.apple.CFNetwork 0x95a59a32 CFURLCacheWorkerThread(void*) + 396
    5 libSystem.B.dylib 0x93b936f5 pthreadstart + 321
    6 libSystem.B.dylib 0x93b935b2 thread_start + 34
    Thread 0 crashed with X86 Thread State (32-bit):
    eax: 0x000040b0 ebx: 0x0000317d ecx: 0xffffffff edx: 0x00003e18
    edi: 0x00000000 esi: 0x004123a0 ebp: 0xbfffe5c8 esp: 0xbfffe470
    ss: 0x0000001f efl: 0x00010282 eip: 0x93d211f0 cs: 0x00000017
    ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037
    cr2: 0x00000030

    works now...hadn't initialized the database

  • Setup program crashes when you try to install a 2007 Office on a 64-bit version of Windows 7

    Hello there,
    I have a Dell Vostro machine with Windows 7 Pro 64-bit installed on it. It came with Office 2010 preinstalled on it. About 6 months ago I removed Office 2010 and installed Office 2007 with no problems. Yesterday a user messed up her office so badly
    that I had to uninstalled it in an attempt to reinstall to ensure that all missing files exist. A few seconds after selecting my options, the installation program crashes. I tried it with a few different users logged in to make sure it's something related
    to the profile of the user I was logged in as.
    Just to be clear, this is the same Office 2007 installation that was installed correctly on it about 6 months ago and the same product key.
    Why is this happening and how can I fix this issue without having to restore the computer to its default state?
    Any help is appreciated.
    Thank you,

    Hi,
    Please refer to this kb, use Microsoft Fix it 50154 to uninstall Office 2007 completely:
    http://support.microsoft.com/kb/928218/en-us
    Then try installing again.
    We can also perform a clean boot to install, which gets rid of the background program conflicts:
    http://support.microsoft.com/kb/929135
    Hope this can help.
    Regards,
    Melon Chen
    TechNet Community Support

Maybe you are looking for

  • Why won't my mac detect an external display?

    I have a mac book pro - system OS X 7.3 - but when I plug my rocketfish adapter to HDMI cable to samsung TV - the TV says it gets no  signal. I've done everything the experts have said about connecting with the right specific order. But my display do

  • Creating a materialized view for another user

    I don't seem to find the correct setup for this.... With the user "dummy" CREATE MATERIALIZED VIEW dummy.thetable BUILD IMMEDIATE REFRESH FORCE ON DEMAND AS select * from real.thetable; And the materialized view is created ok. With a DBA user: CREATE

  • Site not working in IE, fine in Firefox

    It took me forever to get some issues resolved with Captivate/Flash and get my site working correctly. I use Firefox and didn't think to check IE. I called the client and he has IE and said there was nothing there, much to my shock. Everything shows

  • No Implementing class registered for the Interface : ES-TransportationOrderSCMExecutionRequest_In

    Dear PI Experts, I'm currently working on an integrated solution between TM <=> PI <=>ECC. When I trigger the Shipment creation from TM to ECC, I received an error in the SXMB_MONI of ECC. In the XML, I figured the error that No Implementing class re

  • How can I create a randomized smart playlist?

    When I create a smart playlist, pick a playlist and select add Random, it puts all the songs in alphabetical order.  Randomizes the artists but not the music.  In older versions of Itunes this worked. Figurerd it out..the triangle at the top of the #