Difference for method stack size in release and debug builds

Hi,
I have a question regarding the method stack size. Running my project in the debug version works fine. Running the same project as release causes a StackOverflowError (60 entries). Is there any difference in the allowed stack size?
If I split the method (in which the error occurs) into two separate methods and call them sequentially, this works in the release build as well.
I am using Flex SDK 3.4. This is reproducable on Win and Mac.
Cheers
Philipp

Hi,
I have a question regarding the method stack size. Running my project in the debug version works fine. Running the same project as release causes a StackOverflowError (60 entries). Is there any difference in the allowed stack size?
If I split the method (in which the error occurs) into two separate methods and call them sequentially, this works in the release build as well.
I am using Flex SDK 3.4. This is reproducable on Win and Mac.
Cheers
Philipp

Similar Messages

  • Release and Debug builds

    [LInux]
    I noticed that when I first start to create a project in Eclipse that it shows a small dialog box with to options checked, release & debug, and I make sure they are both checked. But when I would do a build it would do both executables debug (with debugging symbols) and release (without debugging symbols). I had to find a second options and I don't remember if it was in Properties or Preferences because I can't seem to find that option again.
    So what's the difference between the dialog box that shows up with both debug and release checked when you first start a project and the option that I found in properties or preferences for building both?
    Also, I can't find that option again in properties or preferences and also for whatever reason the dialog box with debug and release options has stopped coming up when I create a project. Any ideas? Thanks.
    One last thing. Is there a way to keep a group of projects under one tree in the Project Explorer? When I'm going through one, or several programming books at a time I don't want to stack 200 projects on top of each other in the project explorer. If I'm going through a particular programming book I'd like to keep all of it's projects in their own tree. Thanks again.

    Garrett Gaston wrote on Sat, 08 August 2015 12:27[LInux]
    I noticed that when I first start to create a project in Eclipse that it shows a small dialog box with to options checked, release & debug, and I make sure they are both checked. But when I would do a build it would do both executables debug (with debugging symbols) and release (without debugging symbols). I had to find a second options and I don't remember if it was in Properties or Preferences because I can't seem to find that option again.
    So what's the difference between the dialog box that shows up with both debug and release checked when you first start a project and the option that I found in properties or preferences for building both?
    Also, I can't find that option again in properties or preferences and also for whatever reason the dialog box with debug and release options has stopped coming up when I create a project. Any ideas? Thanks.
    When you create a new C++ project for an executable or a library, it always give you the option to edit the build configurations on the 2nd or 3rd window of the wizard.
    If you don't set it, you don't enable that specific configuation and it won't be built.
    To build only a single configuration at time, you should firstly set it through Project -> Build configurations -> Set active, and afterwards click on Projects -> Build project.
    I suspect the behaviour you are noticing occurs when you perform "Build all".
    Once a project is created, you can edit the configurations from Project properties -> C++ Build -> Manage configurations, it is a button on the right of the current configuration being selected.
    Quote:One last thing. Is there a way to keep a group of projects under one tree in the Project Explorer? When I'm going through one, or several programming books at a time I don't want to stack 200 projects on top of each other in the project explorer. If I'm going through a particular programming book I'd like to keep all of it's projects in their own tree. Thanks again.
    As you've already noticed, one way would be to organise them on working sets. This is what I am currently using right now, and personally I'm finding quite confusing to handle.
    However I've seen several people that just create a new workspace to organise a different set of related projects. You can switch a workspace from File -> Switch to workspace. Then if you want to check two projects in two different workspaces, you need to have two separate instances of Eclipse running, as far as I've understood.

  • Xcode target names only 'release' and 'debug'

    Hi,
    We like to create more build targets in our project, at the moment we have the standard 'release' and 'debug'. For a new version we need targets like 'release 4.1' and 'release 5.0' now. I duplicated the target entry, but if I try to build a target with a name different from 'debug' or 'release', I got an error: "file not fount: @executable_path/WidgetBinLib.dylib". If I change the target name to 'release' or 'debug' it works.
    Any idea, how we can use the other target names? Any settings we must change?
    thanks
    Klaus

    I think is something wrong with  .fr.rsrc/.fr files of duplicated target, Make sure the new target doesn't have an included from source target.
    HTH,
    -Kamran

  • How do you detect whether release or debug build using compiler preprocess​or directives​?

    Hi - I want to detect during compilation whether the user has set CVI to compile the code as a release build or as a standard debug build.  Are there simple preprocessor conditionals to test for this?
    Thanks
    Gareth
    Solved!
    Go to Solution.

    Hey Gareth -
    The _CVI_DEBUG_ predefined macro will be set for debug builds.  You can see the list of all predefined macros by going to Options»Build Options»Predefined Macros.
    NickB
    National Instruments

  • Gif and JPG save for web file sizes in CS2 and CS3

    Gif 64 dittered default CS2=2.63KB CS3=4.83KB
    JPG CS2Low=1.42KB CS3=4.03KB
    JPG CS2Medium=1.90KB CS3=4.51KB
    JPG CS2High=3.38KB CS3=5.99KB
    Why? Is there any solution besides keep using CS2 for web?
    Thank's in advance.
    regards
    Fernando Bergamaschi

    Each of the three JPG files increases by the same amount -- 2.61 Kbytes. That sure sounds like some common header block is being added in CS3. Did you check the "Optimize menu" button next to "Preset" just to make double-sure "Include XMP" isn't enabled? Or some other setting like that? Or check both images in Bridge to see if something is being added.

  • Differences for show dev_io in 7.6 and 7.8

    Hi all,
    I am using show dev_io to get the "speed" for underlying hard drives for my system.
    Some days ago we changed from 7.6 to 7.8.
    In 7.6 show dev_io gave me a
    ...........Read....avg_read......Write..avg_write
    ...........count.......time......count.......time
    D0001....1324007.....0.0068.....496347.....0.0305
    D0001........242.....0.1429.......6008.....0.0509
    In 7.8 I get a
    ......Devs...Read(s).....Read..AvgRead.Write(s)....Write.AvgWrite
    ........No.....Count....Pages.Time(ms)....Count....Pages.Time(ms)
    D0001.....2....12914....12993...21.891.....3304.....5374..140.306
    D0001.....2..1855002..1875938....8.389...719347..1061479...31.165
    D0001.....2...167654...169845...17.646....84098...129431...42.894
    D0001.....2....59972....60495...21.315....23834....36496...65.520
    D0001.....2....29263....29425...22.880.....8535....12950...94.218
    D0001.....2.....7417.....7457...11.110........0........0....0.000
    D0001.....2........3........3...21.587........0........0....0.000
    I believe the disks below the database stayed the same, so the speed should be the same, too. But I can't connect the data. Did the database got faster? Did the underlying disks change? Does "show dev_io" use a different algorithm in 7.8  to get the disc speed?
    Anybody out there who can help?
    Thank you.
    Best regards
    Christian

    Which version of photoshop are you using?

  • Tabulate the main difference in the SAP 4.6C Release and ECC 6.0

    hi Experts
    we all are using both the system and know that some additional functionality has been added to the newer versions of SAP.
    Exactly we are sure to differentiate between step one version of SAP.
    To give the clear feedback to our client who is already using 4.6C version and want to upgrade it with ECC 6.0.
    Can some one give me the brief change in the functionality / changes happen in both the versions?
    Your valuable reply give me a lots of support that where we attack in the implementation part to design same business functionality with the new upgraded enviornmrnt.
    Thanks and Regards
    Dilip Jain

    I got it at SAP help site

  • Error stack size

    Hi,
    i have build a package framework which in exceptional situations uses an encapsulated raise_application_error method with the
    -add to error stack- option. In combination with
    -speaking- messages it seems as if i am now running against the error stack size border. What i see is that the primarily generated errors are lost.
    Is it possible (and recommended) to increase the size and does anyone now how to do this ? (I still have to use 8.1.7)
    Thanks in advance,
    Bjoern

    First of all: you should mention it when you cross-post, to prevent people from wasting their time providing an answer already given in the other site.
    https://community.jboss.org/thread/223626
    Doing a google for "The stack size specified is too small, Specify at least 160k" gives plenty of reason to believe it is not really a 'problem', but simply a requirement of the JVM; how and why can only be answered by the developers of said JVM, you're not going to find them here because this is a user to user forum. And this isn't any different under Java 7.
    So other than downgrading, I don't see how you're going to make any impact. I would do the Google yourself, collect the search results that all indicate that the startup scripts are adjusted to the wishes of the JVM and present that to the vendor to shut them up. Anything more - well good luck getting an official statement from Oracle.

  • Stack Size

    For an assignment I had to create a postfix calculator, and one of the errors we had to catch was:
    if there is more then one integer left in the stack when printing the final result, it needs
    to give an error message and exit.
    We were provided the implementation and interface for the Stack by our instructor and here is the method he used for toString.
        public String toString() {
         if (empty()) {
             return "Empty Stack";
         } else {
             return recursiveToString(top);
        /* recursive method to print a non-empty stack
         * @param     the starting index in the array
         * @return     a string representing the stack
        private String recursiveToString(IntNode start) {
         if (start == null) {
             return "";
         String separator = "";
         if (start != top) {
             separator = " :: ";
         return recursiveToString(start.getNext()) +
                    start.getValue() + separator;
        }Basically if there is more than one integer in the stack it will print it like so:
    1 :: 2 :: 3 :: 4
    This is what I used to tell if there was more than one integer left in the stack when printing the final results. I used this code:
    //Checking for the "::" that the toString method prints between integers
    //when there is more than one left in the stack. If there is more the one
    //integer left in the stack then give an error and exit.
    for(int i = 0; i < intStack.toString().length(); i++) { //looping through the toString
    //if there are two colons, consecutively, there is more than one integer in the stack
         if(intStack.toString().charAt(i) == ':' && intStack.toString().charAt(i+1) == ':') {
              System.out.println("Error:\tMore than one integer in final stack. Make sure equations\n\tin " + param[0] + " are valid. Exiting program...");
              System.exit(1);
    }Now my question is... is there a better way to do this? Ideally I would like this part to work regardless
    of how the toString method formats the integers. Because right now if the toString method was
    changed my little check would not work. So is there a way to determine the amount of items in a stack
    or a better way to do this.
    To give a better understanding of those snippets here is the code as a whole:
    import java.util.EmptyStackException;
    import java.util.Scanner;
    import java.io.File;
    public class KinseyAnthony4 {
         public static void main(String[] param) {
              /** Declare new IntLinkedStack Stack Object */
              IntLinkedStack intStack = new IntLinkedStack();
              //Make sure there is only one parameter entered.
              if(param.length == 1) {
                   //try to read the file
                   try {
                        /** declaring new file object */
                        File calcMe = new File(param[0]);
                        /** declaring new scanner object */
                        Scanner readIt = new Scanner(calcMe);
                        /** declaring int for line number */
                        int line = 1;
                        /** declaring int for first number popped from stack */
                        int top = 0;
                        /** declaring int for second number popped from stack */
                        int next = 0;
                        /** declaring int to hold the result of calculations */
                        int result = 0;
                        //Report current status
                        System.out.println("Reading through " + param[0] + ":");
                        //Use loop to view each line until there are none left
                        while(readIt.hasNextLine()) {
                            /** declaring string that holds current line's content */
                             String lineContent = readIt.nextLine();
                             //Report current line number and it's contents
                             System.out.println("\nLine " + line + ": " + lineContent);
                             //Use for loop to analyze each character in the line
                             for(int i=0; i < lineContent.length(); i++) {
                                  //Is it a digit?
                                  if(Character.isDigit(lineContent.charAt(i))) {
                                       /** declaring int that holds numeric value of the char */
                                       int pushMe = Character.getNumericValue(lineContent.charAt(i));
                                       //Report what's being pushed on stack
                                       System.out.println(">Pushing " + pushMe + " to stack.");
                                       //Push the value on the stack
                                       intStack.push(pushMe);
                                  //It's not a digit
                                  else {
                                       //Use a switch statement for computations
                                       switch(lineContent.charAt(i)) {
                                            //Multiplication
                                            case '*':
                                                 top = intStack.pop(); //Pop top number
                                                 System.out.println(">Popping " + top + " from stack."); //Status
                                                 next = intStack.pop(); //Pop next number
                                                 System.out.println(">Popping " + next + " from stack."); //Status
                                                 result = next * top; //Multiply them
                                                 System.out.println(">Calculating " + next + " * " + top); //Status
                                                 intStack.push(result); //Push result back onto stack
                                                 System.out.println(">Pushing result of " + result + " to stack."); //Status
                                                 break;
                                            //Division
                                            case '/':
                                                 top = intStack.pop(); //Pop top number
                                                 System.out.println(">Popping " + top + " from stack."); //Status
                                                 next = intStack.pop(); //Pop next number
                                                 System.out.println(">Popping " + next + " from stack."); //Status
                                                 result = next / top; //Divide them
                                                 System.out.println(">Calculating " + next + " / " + top); //Status
                                                 intStack.push(result); //Push result back onto stack
                                                 System.out.println(">Pushing result of " + result + " to stack."); //Status
                                                 break;
                                           //Addition
                                            case '+':
                                                 top = intStack.pop(); //Pop top number
                                                 System.out.println(">Popping " + top + " from stack."); //Status
                                                 next = intStack.pop(); //Pop next number
                                                 System.out.println(">Popping " + next + " from stack."); //Status
                                                 result = next + top; //Add them
                                                 System.out.println(">Calculating " + next + " + " + top); //Status
                                                 intStack.push(result); //Push result back onto stack
                                                 System.out.println(">Pushing result of " + result + " to stack."); //Status
                                                 break;     
                                            //Subtraction
                                            case '-':
                                                 top = intStack.pop(); //Pop top number
                                                 System.out.println(">Popping " + top + " from stack."); //Status
                                                 next = intStack.pop(); //Pop next number
                                                 System.out.println(">Popping " + next + " from stack."); //Status
                                                 result = next - top; //Subtract them
                                                 System.out.println(">Calculating " + next + " - " + top); //Status
                                                 intStack.push(result); //Push result back onto stack
                                                 System.out.println(">Pushing result of " + result + " to stack."); //Status
                                                 break;
                                            //Invalid Characters
                                            default:
                                                 //Ignore them if they're spaces
                                                 if(!Character.isSpaceChar(lineContent.charAt(i))) {
                                                      //So if they're not spaces give an error and exit
                                                      System.out.println("Error:\tInvalid character read. Exiting program...");
                                                      System.exit(1);
                                                      break;
                             //Checking for the "::" that the toString method prints between integers
                             //when there is more than one left in the stack. If there is more the one
                             //integer left in the stack then give an error and exit.
                             for(int i = 0; i < intStack.toString().length(); i++) { //looping through the toString
                                  //if there are two colons, consecutively, there is more than one integer in the stack
                                  if(intStack.toString().charAt(i) == ':' && intStack.toString().charAt(i+1) == ':') {
                                       System.out.println("Error:\tMore than one integer in final stack. Make sure equations\n\tin " + param[0] + " are valid. Exiting program...");
                                       System.exit(1);
                             //Once it passes that check, print the final calculation
                             System.out.println("***The final result is " + intStack.toString() + "***");
                             //Clear the stack for the following loop
                             while(!intStack.toString().equals("Empty Stack")) {
                                  intStack.pop();
                             //Increment the line number and loop back
                             line++;
                        //If it's the end of the file, exit
                        System.exit(1);
                   //catch invalid postfix equations
                   catch(Exception e) {
                        System.out.println("\nError:\tThe " + e + " occured while reading " + param[0] +".\n\tMake sure equations in " + param[0] + " are valid. Exiting program...");
                        System.exit(1);
              //The user entered more than one parameter
              else {
                   //Give the error and exit
                   System.out.println("Error:\tToo many parameters. One file name parameter is allowed. " + param.length + " were found. Exiting program...");
                   System.exit(1);
    /* a stack of ints implemented using a linked list of nodes
    * @author     Biagioni, Edoardo
    * @assignment     lecture 8 and homework 4
    * @date     February 6, 2008
    class IntLinkedStack implements IntStackInterface {
        /* only need to store a single pointer to the node holding
         * the top of the stack.
         * The pointer is null if the stack is empty.
        private IntNode top;
        /* no-arguments default constructor creates an empty stack */
        public IntLinkedStack() {
         top = null;          // start with an empty stack
        /* @return     whether the stack is empty */
        public boolean empty() {
         return (top == null);
        /* @param     int to push onto the stack */
        public void push(int value) {
         top = new IntNode(value, top);
        /* @return     the top int on the stack */
        public int pop() throws EmptyStackException {
         if (empty()) {
             throw new EmptyStackException();
         int result = top.getValue();
         top = top.getNext();
         return result;
        /* convert the stack to a printable string
         * @return     a string representing the stack
        public String toString() {
         if (empty()) {
             return "Empty Stack";
         } else {
             return recursiveToString(top);
        /* recursive method to print a non-empty stack
         * @param     the starting index in the array
         * @return     a string representing the stack
        private String recursiveToString(IntNode start) {
         if (start == null) {
             return "";
         String separator = "";
         if (start != top) {
             separator = " :: ";
         return recursiveToString(start.getNext()) +
                    start.getValue() + separator;
        // simple test
        public static void main(String[] args) {
         IntStackInterface s = new IntLinkedStack();
         System.out.println("before pushing anything, " + s);
         s.push(999);
         s.push(216);
         System.out.println("after pushing 999 and 216, " + s);
         System.out.println("pop returns " + s.pop());
         System.out.println("after popping, " + s);
         // push 100 values
         for (int i = 0; i < 100; i++) {
             s.push(i);
         // now pop them and make sure the same values are returned
         // in LIFO order
         for (int i = 99; i >= 0; i--) {
             int returned = s.pop();
             if (returned != i) {
              System.out.println("error: pop returns " + returned +
                           ", expected " + i);
         s.push(477);
         s.push(381);
         s.push(888);
         System.out.println("after pushing 477, 381, 888, " + s);
         System.out.println("pop returns " + s.pop());
         System.out.println("pop returns " + s.pop());
         System.out.println("pop returns " + s.pop());
         System.out.println("pop returns " + s.pop());
         System.out.println("after popping, " + s);
         /* expected output:
        private class IntNode {
            /* two fields, the first to store the item itself,
             * the second is a pointer to the next node in the linked list.
          * If there is no next node, the pointer is null.
         private int item;
         private IntNode nextNode;
         /* constructor:
          * @param     value, the value for the node
          * @param     next, the next node in the linked list
         public IntNode(int value, IntNode next) {
             item = value;
             nextNode = next;
         /* accessor methods -- since there are no mutator methods,
          * each node is immutable.
         public int getValue() {
             return item;
         public IntNode getNext() {
             return nextNode;
    /* an interface to a stack of ints
    * @author     Biagioni, Edoardo
    * @assignment     lecture 8 and assignment 4
    * @date     February 6, 2008
    * @inspiration     William Albritton's integer stack and Java's stack class,
    *http://www2.hawaii.edu/~walbritt/ics211/stackArray/IntegerStackInterface.java
    * http://java.sun.com/j2se/1.5.0/docs/api/java/util/Stack.html
    interface IntStackInterface {
        /* @param     string to push onto the stack */
        void push(int value);
        /* @return     the top string on the stack */
        int pop()
         throws java.util.EmptyStackException;
        /* @return     whether the stack is empty */
        boolean empty();
    }and this is the file i tested it on:
    98-
    1 1 +
    7 2 /
    8 1 1 + /
    2 3 * 1 -
    5 5 + 2 2 * -
    8 2 / 9 3 / +
    2 2 * 2 *
    1 2 3 1 + * +
    2 6 + 3 - 2 *The outcome should be 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
    Thanks in advance, any help would be appreciated!

    AnthonyJK wrote:
    Thanks, I'm working on breaking it into methods now.Good.
    I also whipped something up,but I currently don't have access to a compiler so there might be errors in it. It's basically the same as what your big main method does, but in a much more readable manner:
    public class KinseyAnthony4 {
         * @param a     the first number
         * @param op    the mathematical operator
         * @param b     the second number
         * @return      the outcome of the expression 'a <op> b'
        private static int evaluate(int a, char op, int b) {
            switch(op) {
            case '+': return a+b;
            case '-': return a-b;
            case '*': return a*b;
            case '/': return a/b;
            default: throw new RuntimeException("Unknown operator: "+op);
         * @param calcMe    the File in which the expressions are stored.
         * @return          the expressions as an array of Strings.
        private static String[] readLinesFrom(File calcMe) throws FileNotFoundException {
            List<String> lines = new ArrayList<String>();
            Scanner readIt = new Scanner(calcMe);
            while(readIt.hasNextLine()) {
                String line = readIt.nextLine();
                line = line.replace(" ", ""); // remove all white spaces
                lines.add(line);
            return lines.toArray(new String[]{});
         * @param param     one parameter needed: the file containing the expressions
        public static void main(String[] param) throws FileNotFoundException {
            if(param.length != 1) {
                System.out.println("usage: java KinseyAnthony4 FILENAME");
                System.exit(666);
            String[] expressions = readLinesFrom(new File(param[0]));
            for(String exp: expressions) {
                System.out.println("\nLINE = "+exp);
                IntLinkedStack stack = new IntLinkedStack();
                for(char ch: exp.toCharArray()) {
                    if(ch >= '0' && ch <= '9') {
                        int digit = Character.getNumericValue(ch);
                        System.out.println("push: "+digit);
                        stack.push(digit);
                    } else {
                        int b = stack.pop();
                        int a = stack.pop();
                        System.out.println("pop: "+a);
                        System.out.println("pop: "+b);
                        System.out.println("calculating: "+a+" "+ch+" "+b);
                        int temp = evaluate(a, ch, b);
                        System.out.println("push: "+temp);
                        stack.push(temp);
                int result = stack.pop();
                System.out.println("***The final result is "+result+"***");
    }Now as to your problem: you see that the pop() method throws an exception? You can wrap the necessary lines of code between *try { ... } catch(...) { ... }* statements to catch the exception when an expression in malformed. I hope that makes a bit sense to you, if not, post back.
    Good luck.

  • New FAQ Entry on JVM Parameters for Large Cache Sizes

    I've posted a new [FAQ entry|http://www.oracle.com/technology/products/berkeley-db/faq/je_faq.html#60] on JVM parameters for large cache sizes. The text of it is as follows:
    What JVM parameters should I consider when tuning an application with a large cache size?
    If your application has a large cache size, tuning the Java GC may be necessary. You will almost certainly be using a 64b JVM (i.e. -d64), the -server option, and setting your heap and stack sizes with -Xmx and -Xms. Be sure that you don't set the cache size too close to the heap size so that your application has plenty of room for its data and to avoided excessive full GC's. We have found that the Concurrent Mark Sweep GC is generally the best in this environment since it yields more predictable GC results. This can be enabled with -XX:+UseConcMarkSweepGC.
    Best practices dictates that you disable System.gc() calls with -XX:-DisableExplicitGC.
    Other JVM options which may prove useful are -XX:NewSize (start with 512m or 1024m as a value), -XX:MaxNewSize (try 1024m as a value), and -XX:CMSInitiatingOccupancyFraction=55. NewSize is typically tuned in relationship to the overall heap size so if you specify this parameter you will also need to provide a -Xmx value. A convenient way of specifying this in relative terms is to use -XX:NewRatio. The values we've suggested are only starting points. The actual values will vary depending on the runtime characteristics of the application.
    You may also want to refer to the following articles:
    * Java SE 6 HotSpot Virtual Machine Garbage Collection Tuning
    * The most complete list of -XX options for Java 6 JVM
    * My Favorite Hotspot JVM Flags
    Edited by: Charles Lamb on Oct 22, 2009 9:13 AM

    First of all please be aware HSODBC V10 has been desupported and DG4ODBC should be used instead.
    The root cause the problem you describe could be related to a timeout of the ODBC driver (especially while taking care of the comment: it happens only for larger tables):
    (0) [MySQL][ODBC 3.51 Driver]MySQL server has gone away (SQL State: S1T00; SQL
    (0) Code: 2006)
    indicates the Driver or the DB abends the connection due to a timeout.
    Check out the wait_timeout mysql variable on the server and increase it.

  • Problem with "SELECT...FOR UPDATE OF..." and "POST command" combination

    Problem with "SELECT...FOR UPDATE OF..." and "POST command" combination
    Problem in committing transactions in Multiple Forms (Oracle Forms) with POST built-in command:
    Consider that the following statements are written in WHEN-WINDOW-CLOSED trigger of a called form.
    Statements in called form (Form name: FORM_CHILD):
    go_block('display_block') ;
    do_key('execute_query') ;
    -- Data from table_b will be populated in this block, based on the value of COLUMN_1 obtained
    -- from TABLE_A.
    -- Example: If the value of COLUMN_1 is 10, then all the matching records from TABLE_B, which
    -- are inserted with value 10 in TABLE_B.COLUMN_1 will be fetched and shown here.
    if user_choice = 'YES' then
    commit ;
    else
    rollback ;
    end if ;
    Statements in calling forms:
    There are two calling forms having following statements and it is going to call the above said called form.
    CALLING FORM 1
    Statements in KEY-COMMIT trigger:
    post;
    call_form(form_child, no_activate) ;
    Statements in ON-INSERT trigger:
    select column_1
    from table_a
    for update of column_1
    where column_2 = 'X' ;
    update table_a
    set column_1 = column_1 + 1
    where column_2 = 'X' ;
    insert into table_b ...;
    insert into table_b ...; Statements in KEY-COMMIT trigger:
    post;
    call_form(form_child, no_activate) ;
    CALLING FORM 2:
    Statements in ON-INSERT trigger:
    select column_1
    from table_a
    for update of column_1
    where column_2 = 'X' ;
    update table_a
    set column_1 = column_1 + 1
    where column_2 = 'X' ;
    insert into table_b ...;
    insert into table_b ...;
    insert into table_b ...;
    Our understanding:
    Assume that both the forms are running from two different machines/instances, issuing commit at the same time. In this case, forms will start executing the statements written in ON-INSERT trigger, the moment POST command is executed. Though the commit is issued at the same time, according to oracle, only one of the request will be taken for processing first. Assume that calling form 1 is getting processed first.
    So, it fetches the value available in COLUMN_1 of TABLE_A and locks the row from further select, update, etc. as SELECT...FOR UPDATE command is used (note that NOWAIT is not given, hence the lock will be released only when COMMIT or ROLLBACK happens) and proceed executing further INSERT statements. Because of the lock provided by the SELECT...FOR UPDATE command, the statements in calling form 2 will wait for the resource.
    After executing the INSERT statements, the FORM_CHILD is called. The rows inserted in to TABLE_A will be queried and shown. The database changes will be committed when user closes the window (as COMMIT is issued in its WHEN-WINDOW-CLOSED trigger). Then the SELECT...FOR UPDATE lock will be released and calling form 2's statements will be executed.
    Actual happenings or Mis-behavior:
    Calling form 2 starts executing INSERT statements instead of waiting for SELECT...FOR UPDATE lock. Also, the value selected from TABLE_A.COLUMN_1 is same in both the calling forms, which is wrong.
    The rows inserted into TABLE_B are having similar COLUMN_1 values in calling form 2 and they are fetched and shown in the called form FORM_CHILD.
    Note that in calling form 2 also POST only is issued, but the changes posted there are accessible in calling form 1 also, which is wrong.
    Kindly suggest us as to how to fix above problem. It will be much use, if you can send us the information regarding the behavior of Oracle Forms POST built-in also.
    Our mail ID: [email protected]
    Thanks a lot in advance.

    You have several problems:
    1. On-Insert will ONLY run if you have created a new record in a base-table block. If you haven't done that, then the POST command will not cause it to run.
    2. Select for update without a "no wait" will lock records for the first form, but when the second form tries this, it will hit the ORA-00054 exception, and will NOT wait. The only way you could make it wait is to issue an UPDATE sql command, which is not such a good way to go.
    All POST does is issues SQL insert or update commands for any changes the user has made to records in a form's base-table blocks, without following with a Commit command.
    Also understand that Commit is the same as Commit_Form, and Rollback is the same as Clear_Form. You should read up on these in the Forms help topics.

  • Release vs Debug: Bad Memory Access

    Hello everyone.
    For a school assignment I have to write a program that sorts bottles (inputed by the user) into three bins, and state the minimum amount of moves it takes. I've completed the program, that's not really the problem.
    There is a drop down menu up on the top left, and it gives me the option between 'Release' and 'Debug' (under Active Configuration). Now I don't quite understand the difference, but expected for the final copy it should be compiles with it set to Release. But that's just an assumption.
    The problem is, or maybe this is just a question, when I set it to Debug and build my program, it runs great. If I change this option to Release and run the program I get "EXCBADACCESS" and the program fails.
    My main worry is this might indicate a potential problem with compatibility on other platforms (maybe). I've compiled the program in Terminal with GCC and it works fine there as well. I will post my code below if it helps any. My hope is this is either a bug in xcode, or simply nothing to worry about.
    I've underlined the area XCode highlights when the error occurs. Thank you.
    #include <stdio.h>
    #include <stdlib.h>
    const char bottle_colour[][6]={"red","white","blue"};
    int main()
    int i,low,move[6],bottles[3][3];// bottles[bin][colour]
    for (i=0;i<3;i++)
    printf("Please enter the amount of %s bottles in each bin with a space inbetween each amount\n",bottle_colour);
    scanf("%i%i%i",&bottles[0],&bottles[1],&bottles[2]);
    printf("\n");
    move[3] += bottles[1][0] + bottles[2][0];// Moving all red bottles to bin 1
    move[3] += bottles[0][1] + bottles[2][1];// Moving all white bottles to bin 2
    move[3] += bottles[0][2] + bottles[1][2];// Moving all blue bottles to bin 3
    move[2] += bottles[1][0] + bottles[2][0];// Moving all red bottles to bin 1
    move[2] += bottles[0][1] + bottles[1][1];// Moving all white bottles to bin 3
    move[2] += bottles[0][2] + bottles[2][2];// Moving all blue bottles to bin 2
    move[5] += bottles[0][0] + bottles[2][0];// Moving all red bottles to bin 2
    move[5] += bottles[1][1] + bottles[2][1];// Moving all white bottles to bin 1
    move[5] += bottles[0][2] + bottles[1][2];// Moving all blue bottles to bin 3
    move[4] += bottles[0][0] + bottles[2][0];// Moving all red bottles to bin 2
    move[4] += bottles[0][1] + bottles[1][1];// Moving all white bottles to bin 3
    move[4] += bottles[1][2] + bottles[2][2];// Moving all blue bottles to bin 1
    move[1] += bottles[0][0] + bottles[1][0];// Moving all red bottles to bin 3
    move[1] += bottles[1][1] + bottles[2][1];// Moving all white bottles to bin 1
    move[1] += bottles[0][2] + bottles[2][2];// Moving all blue bottles to bin 2
    move[0] += bottles[0][0] + bottles[1][0];// Moving all red bottles to bin 3
    move[0] += bottles[0][1] + bottles[2][1];// Moving all white bottles to bin 2
    move[0] += bottles[1][2] + bottles[2][2];// Moving all blue bottles to bin 1
    for (i=0;i<5;i++)
    _if (move[i+1] < move && move[i+1] < move[low])_
    low = i + 1;
    printf("\nThe lowest amount of moves it would take is %i.",move[low]);

    Well, welcome to programming.
    The code as printed obviously isn't quite right due to formatting problems. There's a way to format it so it is displayed correctly but I don't know it off hand.
    If you use look at the build warnings you'll get a pretty good idea what is going on. In general there should be few or zero warnings in the build process. They're there for a reason. C provides a lot of rope.
    A few issues right away from the command line compiler:
    s.c:12: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘const char (*)[6]’
    s.c:13: warning: format ‘%i’ expects type ‘int *’, but argument 2 has type ‘int (*)[3]’
    s.c:13: warning: format ‘%i’ expects type ‘int *’, but argument 3 has type ‘int (*)[3]’
    s.c:13: warning: format ‘%i’ expects type ‘int *’, but argument 4 has type ‘int (*)[3]’
    I presume the following code
    if (movei+1 < move && movei+1 < movelow)
    low = i + 1;
    is
    if (move[i+1] < move && move[i+1] < move[low])
    low = i + 1;
    If so, I see the following warning:
    s.c:43: warning: comparison between pointer and integer
    Trust me, the issue is not portability at all nor a bug in Xcode. There are significant bugs in this code that just happen to compile.
    For instance, in line 12, the %s takes a pointer to a string yet a pointer to an array of strings has been provided.
    In line 13, the scanf %i operator requires a pointer to an integer yet a pointer to an array of pointers as been provided. You should have passed something such as &bottles[x][y] for each of those arguments.
    If you actually have 'move && move[i+1]' in the code, the code is comparing an address to an integer and I'm sure that's not intended.
    Lastly, 'low' is not initialized (those are difficult to find and the compiler does not warn of them even when using the -Wall flag). Probably should be set to zero. Different compilers and platforms vary on guarantees of a zero value.
    Since this is a project in school I will stop at this (and there are more issues in the code than I have stated).
    It'll all come in time. Good luck to you.

  • Why ulimit  fails for stack size in Sol 10 update 11 with project settings?

    Hi,
    The following command fails on Solaris 10 update 11 platform. It works fine with update 10. Something has changed in update 11. Any ideas?
    ulimit -Ss 1 (or any number for that matter)
    /bin/ksh: ulimit: exceeds allowable limit
    We have the following setting in project as well.
    process.max-stack-size=(basic,137988707188736,deny)
    process.max-stack-size=(priv,137988707188736,deny)
    Thanks for your help in advance.
    Samy

    Here are the values from the project command if you anyone is wondering
    update 10
    ======
    cat /etc/release
    Oracle Solaris 10 8/11 s10x_u10wos_17b X86
    Copyright (c) 1983, 2011, Oracle and/or its affiliates. All rights reserved.
    Assembled 23 August 2011
    prctl -n process.max-stack-size $$
    process: 10189: /bin/ksh -i
    NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
    process.max-stack-size
    privileged 125TB max deny -
    system 125TB max deny -
    update 11
    ======
    cat /etc/release
    Oracle Solaris 10 1/13 s10x_u11wos_24a X86
    Copyright (c) 1983, 2013, Oracle and/or its affiliates. All rights reserved.
    Assembled 17 January 2013
    prctl -n process.max-stack-size $$
    process: 24776: /bin/ksh -i
    NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
    process.max-stack-size
    basic 125TB - deny 24776
    privileged 125TB - deny -
    system 125TB max deny -

  • Differences between -Xss[size] in linux and windows

    Simple thread test program which runs 3000 threads:
    startup options on windows:
    -server -Xms16m -Xmx16m -Xss7k
    startup options on linux:
    -server -Xms16m -Xmx16m -Xss97k (Why 90k bigger stack size??)
    Linux is using newest kernel and NPTL threads. With 'regular' threads the linux version overflows stack unless -Xss2m is given...
    I Think Sun needs to come up with clear specification of threading models, libraries etc... used in both environments. If you search these forums - one of the most common and baffling error is the sig11 on linux. I think the main cause behind it are the library 'mismatches'.
    Answers to these questions are really needed:
    What is the recommended threading library on linux with each VM version?
    Against which library is the VM tested?
    If anyone has experiences with NPTL threads on 1.4.2 VM please contribute. How many threads did you manage to create, how much memory that took? What distribution, thread library, start up parameters, etc... did you use.
    I'm going to do a bit more experimenting on a real life application during the followin weeks. With simple test program we were able to create over 16000 threads, but if you do the math with the minimum stack size you can guess that the virtual memory usage was sky high!
    P.S.
    I'll post more exact platform specs when I'm back to work tomorrow..

    http://java.sun.com/docs/hotspot/VMOptions.html - see under -Xoss option.
    BTW, I ran my test case again, and now i finally succeeded to prove that 'rule' (see that 'another' thread): Xss*nThreads + Xmx < Xmx_MAX. The conclusions are (at least under 32-bit Linux):
    1) Xss does limit native stack size
    2) the 'rule' seems to be independent of whether u r actually using the allocated stack space or not
    Below a test case is attached. Under 32-bit Linux it crashes before it can create 30 threads with
    Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread
            at java.lang.Thread.start(Native Method)
            at testlab.StackTest.main(StackTest.java:46)exception, if start up parameters are
    java -cp ../../classes -Djava.library.path=./ -Xms1870m -Xmx1870m -Xss1m testlab.StackTest 100 200 1000000The crash point can be moved/eliminated by modifying either Xss param (the smaller the size the later the crush would happen) or Xmn/Xmx (the smaller...., the later....). Exact Xmx_MAX number might depend on what threads library you are running. On my hardware it is as follows:
    java -Xms1920M -Xmx1920M
    Error occurred during initialization of VM
    Could not reserve enough space for object heap
    java -Xms1910M -Xmx1910M
    Error occurred during initialization of VM
    Could not reserve enough space for card marking array
    java -Xms1900M -Xmx1900M
    <RUNS OK>See how error messages differ. So, in the case above Xmx_MAX is around 1.9G.
    Native code was compiled with gcc2.96, under 32-bit RH Linux, no optimizations.
    Java code compiled with 1.4.2_02 compiler, run with JVM is 1.4.2_02
    Java file:
    package testlab;
    * Author: volenin
    * Date: Dec 4, 2003
    * Time: 10:40:20 AM
    * under GPL license
    public class StackTest extends Thread {
      static byte[] arr;
      static {
        System.loadLibrary("stacktest");
      boolean isStarted = false;
      int allocSize;
      StackTest(int allocSize) {
        this.allocSize = allocSize;
        setDaemon(true);
    //    arr2 = new byte[allocSize];
      public void run() {
        isStarted = true;
        allocate(allocSize);
        synchronized (this) {
          try { wait(); }
          catch (InterruptedException Ie) {}
      public native void allocate(int size);
      public static void main(String[] args) throws Exception {
        int nThreads = Integer.parseInt(args[0]);
        int allocSize = Integer.parseInt(args[1]);
        int initSize = Integer.parseInt(args[2]);
        arr = new byte[initSize];
        for (int i = 0; i < nThreads; i++) {
          int n = i+1;
          System.out.println("Creating thread #"+n);
          StackTest test = new StackTest(allocSize);
          System.out.println("Starting thread #"+n);
          test.start();
          System.out.println("Thread started #"+n);
          synchronized (StackTest.class) {
            if (!test.isStarted)   StackTest.class.wait(100);
          System.out.println("Thread running #"+n);
    Native .h file:
    #include <jni.h>
    #ifndef _Included_testlab_StackTest
    #define _Included_testlab_StackTest
    #ifdef __cplusplus
    extern "C" {
    #endif
    JNIEXPORT void JNICALL Java_testlab_StackTest_allocate(JNIEnv *, jobject, jint);
    #ifdef __cplusplus
    #endif
    #endif
    Native .cpp file:
    #include "testlab_StackTest.h"
    JNIEXPORT void JNICALL Java_testlab_StackTest_allocate(JNIEnv *env, jobject jobj, jint allocSize) {
      int arr[allocSize];
      int arrSize = sizeof(arr);
      printf("array allocated: %d, %d\n", allocSize, arrSize);
      getchar();

  • Difference in background colour for methods in BOR

    Hi Experts,
    I have a question regarding background for methods and attributes in BOR usually pink,red and white can anyone tell me the difference.I tried in google and also in SDN but couldnt find the answer.Please dont get annoyed if my question is very silly.Thanks in advance.
    Cheers,
    Srini...

    A good question which any one would have thought regarding this, any ways
    Upto my knowledge
    1. Red color : When ever you try to inherit any interface into your BOR then the methods which are included into your bor will be represented by READ and you cannot implement them
    2. Pink color : The interfaces and the attributes which are included into you BOR will apear in Pink
    3. White Color: the one which you created int he BOR and you have full authorities to change , IMplement and release. where  you don't have this option with other colors.

Maybe you are looking for