JVM 1.5.0, parallelism and object creation

Hi.
I am currently running Java 1.5.0 on a production server. This server is a 4-cpu 2gb ram beast running Red Hat ES 3. It provides MySQL backend and a Java server to be accessed through a Flash client.
So far, the Flash client fares well. MySQL takes worst cast 16% of one CPU for very heavy selections. But I am having problems with optimizing the Java part that does everything.
First and foremost, I cannot change the way it is. Our java code is mostly vendor code, thus we can't really expect to be able to easily change the code. Whatever code we added to the vendor code is definitely not the bottleneck, it's optimized, it's properly synchronized and it's very effective.
I would like to give you an idea of how things fares. You will see my problem soon.
- I am running one process of Java. This process is -Xms and Xmx'ed to 384 megs.
- The total DSize of the Java environment is more than a gigabyte due to the 1000+ threads that runs through it. More so, every client that runs through it adds up at least two threads.
- There are massive object creation and destruction happening. For a 100-client system, the "eden" memory is filled up and GC'ed at least twice per second. Since 1.5.0, the "old" memory of 384m gets filled up in 10 minutes, and GC'ed at that point.
- CPU usage is having fun between 80% and 150% of one CPU (remember I have 4 CPUs so 150% is 150/400% total usage)
- GC is the major speed bump for my server, as if I put 768 megs of Xmm instead of 384, cpu usage drops to 60%-90% CPU, that is, until memory gets filled up and swap gets used (do the math: 768m + 1200 thread stacks)
Now it works fine. 100 users, it's perfect. My major problem is that from next week on, we are planning 300+ users. Ouch.
So my few questions are:
- In knowing that garbage must constantly be collected, is there something I can do in the environment to make it happen all the time in background? Or am I bound to have all 4 cpu's stopped momentarily twice per second so that it might happen?
- In 1.4.x, I could change "eden" memory block size. It doesn't seem to be the same for 1.5.x. What's up with that? I used to increase it dramatically, making GC longer but less frequent, increasing parallelism force.
I am asking the questions because I am not in position of trying "what if"s with my production server. The test server handles well our 8 internal users ... but we are not close of making the same amount of request as our 100-users production server... so we cannot reliably try out options. Best case is see if it crashes or now.
Thanks
Mike

Mikle -- please make sure that you are using either the
UseParallelGC collector or the UseConcMarkSweepCollector.
Both would appear to address some of the problems you
mention.
You may need to tune the size of the young generation
explicitly. Check out the GC tuning documents/tips
at:
http://java.sun.com/docs/hotspot
You should make sure your application is not paging.
Since the default thread stack sizes are large (2 MB?)
and you may not need that much, you can try -Xss256k
(for example) to reduce the virtual memory requirements
for your thread stacks and free up more address space
for the Java heap.
In the end, for an application of the kind you describe you
probably need to go 64-bit and use a larger Java heap
along with the parallel/concurrent collector to deal with the
attendant GC overheads. That (going 64-bit) should be easy
(trivial) if your application is pure Java.
Hi.
I am currently running Java 1.5.0 on a production
server. This server is a 4-cpu 2gb ram beast running
Red Hat ES 3. It provides MySQL backend and a Java
server to be accessed through a Flash client.
So far, the Flash client fares well. MySQL takes worst
cast 16% of one CPU for very heavy selections. But I
am having problems with optimizing the Java part that
does everything.
First and foremost, I cannot change the way it is. Our
java code is mostly vendor code, thus we can't really
expect to be able to easily change the code. Whatever
code we added to the vendor code is definitely not the
bottleneck, it's optimized, it's properly synchronized
and it's very effective.
I would like to give you an idea of how things fares.
You will see my problem soon.
- I am running one process of Java. This process is
-Xms and Xmx'ed to 384 megs.
- The total DSize of the Java environment is more than
a gigabyte due to the 1000+ threads that runs through
it. More so, every client that runs through it adds up
at least two threads.
- There are massive object creation and destruction
happening. For a 100-client system, the "eden" memory
is filled up and GC'ed at least twice per second.
Since 1.5.0, the "old" memory of 384m gets filled up
in 10 minutes, and GC'ed at that point.
- CPU usage is having fun between 80% and 150% of one
CPU (remember I have 4 CPUs so 150% is 150/400% total
usage)
- GC is the major speed bump for my server, as if I
put 768 megs of Xmm instead of 384, cpu usage drops to
60%-90% CPU, that is, until memory gets filled up and
swap gets used (do the math: 768m + 1200 thread
stacks)
Now it works fine. 100 users, it's perfect. My major
problem is that from next week on, we are planning
300+ users. Ouch.
So my few questions are:
- In knowing that garbage must constantly be
collected, is there something I can do in the
environment to make it happen all the time in
background? Or am I bound to have all 4 cpu's stopped
momentarily twice per second so that it might happen?
- In 1.4.x, I could change "eden" memory block size.
It doesn't seem to be the same for 1.5.x. What's up
with that? I used to increase it dramatically, making
GC longer but less frequent, increasing parallelism
force.
I am asking the questions because I am not in position
of trying "what if"s with my production server. The
test server handles well our 8 internal users ... but
we are not close of making the same amount of request
as our 100-users production server... so we cannot
reliably try out options. Best case is see if it
crashes or now.
Thanks
Mike

Similar Messages

  • Suggestion on collections and object creation

    Hi I need to read some data from the Sybase database and make some statistical computations( average, standard Deviation, min/max) for monthly period.
    The data looks like the following:
    Name Score Date
    John 100 06/20/2009
    Mike 200 05/23/2009
    Performance is very important, what is the best way to store that information in a java collection ( I think using ArrayList is the fastest) do you think I need to create an object for each row of information with private fields name, score, date? or is it too time consuming to create objects and store it in an ArrayList?
    I just need to do those calculations above and display it. So, how would you recommend me to do that? If I want best performance (to be fast)
    Thanks.

    Hi thanks for help,
    The thing is, I need all the data if the user wants to see Details, then I will need to display all rows. On the other hand, Sybase doesnt have the stdev function, I wrote a query that calculates stdev, but I will need to run the query once for each person, because it looks like this:
    select
    (SQRT((sum((MyFieldName - (select convert(dec(10,2),avg(MyFieldName))
    From MyTableNameWhere
    MyWhereCriteria and
    abs(MyFieldName)>0))*(MyFieldName - (select convert(dec(10,2),avg(MyFieldName))
    From MyTableNameWhere MyWhereCriteria and abs(MyFieldName)>0)))) /(select count(MyFieldName)-1
    from MyTableNamewhere MyWhereCriteria))) 'StDev'
    from MyTableName WHERE MyWhereCriteria
    where MyWhereCriteria would be
    where date = '07/03/2009' and name = 'John'
    so some of the subqueries return multiple rows which is a problem..
    I got error saing:
    [Error] Script lines: 13-30 ------------------------
    Subquery returned more than 1 value. This is illegal when the subquery follows =, !=, <, <= , >, >=, or when the subquery is used as an expression.
    Msg: 512, Level: 16, State: 1

  • E-recruitment objects NA, ND and NE creation

    Hi,
    I need some clarification on E-rec Objects as I am developing one report. Wherein, I want to pull out all the candidates those are applied for that particular requisition.
    When I give the logic on NA to ND relationship which gets created in HRP1001 then if recruiter has search for candidate in candidate search and pull the candidate and applied to the requisition in that case, the ND has not created for that candidate.
    I have seen one case wherein candidate has applied for a requisition and then  withdrawn the application in that NA to ND has created in HRp1001 but NE is not appearing for this case.
    Kindly give some clarification on these object creation.
    Regards,
    Sarika

    Hi Sarika,
    Please keep in mind that there are cleaner ways to exploit the data model of e-recruiting and that is almost never required to access database tables directly.
    Most relevant classes can be found by searching with pattern CL_HRRCF*BL. This search will give you a list of all business logic classes. Most of the times, these classes contain methods which will also return the text labels for most key fields.
    Regards,
    Luk

  • Reg : object creation for controller and view ?

    hi friends....
    i am new to WDA and objects...
    please explain me..
    when i create the web dynpro component one interface is automatically created as IF_COMPONENTCONTROLLER for component
    IF_MAINVIEW for view
    IF_WINDOW for window
    correct me if i am wrong
    suppose if i want to reuse class, i want to create object... like wise
    if i want to reuse interfaces, i want to create object.
    but in this case..for eg (IF_COMPONENTCONTROLLER, IF_MAINVIEW ) where we are creating object...?
    no need to create object ?
    regards
    deva

    >but in this case..for eg (IF_COMPONENTCONTROLLER, IF_MAINVIEW ) where we are creating object...?
    no need to create object ?
    No you don't have instantiate any of the objects.  Think of Web Dynpro as a modeling layer implemented in ABAP Objects, but sitting on top of the Object Oriented constructs.  You still have some of the benfiits of OO - like event registration, inheritance, methods, etc - but a lot of the OO setup is done and maintained by the framework for you.  So although each section of Web Dynpro - the component, the controllers, contexts, views, etc - are all technically ABAP Object instances, you don't have to manage the objects directly.

  • Object creation of string

    Hello
    Please tell me what is the difference between these two object creation of string.
    String str = new String("Hello");.
    String str="Hello";
    Thanks.

    RGEO wrote:
    hello,
    Is the string pool is part of a heap? Huh? I suppose yes, you could regard the String pool as part of the heap... but (I guess) that interned String objects would be placed directly into the permanent generation, which is not garbage collected... and therefore I don't really think of the permanent generation as part of the heap (except when tuning heap allocations)... but I think I'm talking over your noob head here, yes... and so to the noob-stuff.
    If you get bored you might like to scan (for now) http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html#generations ... and come back to it in a couple of years time (when every second word isn't new and baffling to you;-)
    jvm what will do when he encounter the following code,
    String s1 = new String ("hello");The VM will:
    1. Create a new String object, and then
    2. copy the characters 'h','e','l','l','o' from the interned String "hello" to the new String,
    3. and then assign a reference to the new String to variable s1.
    Note that the result is subtley different from String s1 = "hello", which just does step 3... it assigns a reference to the existing interned String object "hello" to the variable s1... it does not create and "populate" a new String object.
    Try this just for fun... what is the output of the following program? Why?
    package forums;
    public class StringEquals
      public static void main(String[] args) {
        try {
          String a = "Hello";
          String b = "Hello";
          System.out.println("a==b is "+(a==b));
          String c = new String("Hello");
          System.out.println("a==c is "+(a==c));
        } catch (Exception e) {
          e.printStackTrace();
    }Now, what's the correct way to evaluate equality of String objects in Java?
    HTH. Cheers. Keith.

  • Aborting new object creation

    I want to test the input parameters to a constructor and determine if an invalid parameter has been supplied.
    If I use:
    Thingy myThingy = new Thingy("invalid value");
    is it up to the programmer of the above to catch the error, either through exception handling or some other form of error checking, and perform
    myThingy = null;
    to render the partially initialized object ready for garbage collection?
    Is there a way in the constructor itself to indicate that the object shouldn't be created and null should be returned as the result of the "new" operation?
    Thanks,
    John

    But I'd say Clem1986 still has a point. Even in the constructor
      Foo() throws Exception {
        throw new Exception("Bollocks");
      }there's the implicit call to super() and instance initializers before you arrive at throw. From JVM spec: The new instruction does not completely create a new instance; instance creation is not completed until an instance initialization method has been invoked on the uninitialized instance. Which is done above. Whether this qualifies in OP's context as completing instance creation or instantiating an object I don't know. But you could work with it in the constructor, and once you get to throw, memory has been allocated, all superclasses have been initialized (which might involve heavy allocation/computation), default values were assigned to fields and instance initializers have executed. Only now can you decide to "abort new object creation" by completing abruptly and not "returning" the reference to the newly-(partially-)created object to the caller.

  • Frequent Object Creation vs. synchronized

    HI all,
    I'm just looking to prompt a discussion I can learn from. Apologies if I'm missing something.
    Having just read the excellent articles over at:
    http://www-106.ibm.com/developerworks/java/library/j-threads1.html
    http://www-106.ibm.com/developerworks/java/library/j-threads2.html
    http://www-106.ibm.com/developerworks/java/library/j-threads3.html
    I was left wondering about the (largely unmentioned) trade-off between object creation and use of synchronization.
    If a particular part of a given system is heavily accessed then one might consider instantiating, and caching references to, components in an initialisation stage. In a multithreaded environment, this can obviously pose a problem.
    If these components aren't threadsafe then at some point use will have to be made of a synchronized block, unless the unsafe components are instantiated for every thread.
    The articles do mention the overrated cost of synchronization - how does this compare with the cost of frequent object instantiation?
    Thanks for your time,
    JohnG

    Well, let's time it (test program below):
    using no synchronization: 180 ms (baseline measurement, not thread safe)
    using new: 1111 ms
    using uncontended sync: 491 ms
    using contended sync: 49531 ms
    new is fast - ten million temporary object allocations and frees per second. A magnitude faster than in traditional malloc()/free() -based languages. new is rarely a performance problem in Java programs.
    Uncontended locks are fast - twenty million per second.
    Heavily contended locks slow you down. Way down. A second becomes a minute.
    Don't try to optimize unless you have measured a real performance bottleneck.
    Object pooling is unlikely to help. Exceptions being objects that are expensive to initialize and are created often (e.g. large buffers or arrays, cryptographic engines that take time to initialize, or connections to external systems such as databases). You'll need to measure first if object creation really is the bottleneck.
    public class t
        static class Calculator
         private int value;
         void initialize(int n)
             value = n;
         int result()
             return value * 2;
        static class NewThread
         extends Thread
         int result;
         public void run()
             for (int n = 0; n < 1000 * 1000; n++) {
              Calculator x = new Calculator();
              x.initialize(n);
              result += x.result();
        static class SyncThread
         extends Thread
         static Calculator x = new Calculator();
         int result;
         public void run()
             for (int n = 0; n < 1000 * 1000; n++) {
              synchronized (x) {
                  x.initialize(n);
                  result += x.result();
        // Not thread safe
        static class BaselineThread
         extends Thread
         static Calculator x = new Calculator();
         int result;
         public void run()
             for (int n = 0; n < 1000 * 1000; n++) {
              x.initialize(n);
              result += x.result();
        public static void main(String args[])
         throws Exception
         int thread_count = 10;
         for (int n = 0; n < 5; n++) {
             Thread threads[] = new Thread[thread_count];
             long start = System.currentTimeMillis();
             for (int m = 0; m < thread_count; m++) {
              // threads run consecutively, not in parallel
              (threads[m] = new BaselineThread()).start();
              threads[m].join();
             long end = System.currentTimeMillis();
             System.out.println("using no synchronization: " +
                          (end - start) + " ms");
         for (int n = 0; n < 5; n++) {
             Thread threads[] = new Thread[thread_count];
             long start = System.currentTimeMillis();
             for (int m = 0; m < thread_count; m++)
              (threads[m] = new NewThread()).start();
             for (int m = 0; m < thread_count; m++)
              threads[m].join();
             long end = System.currentTimeMillis();
             System.out.println("using new: " + (end - start) + " ms");
         for (int n = 0; n < 5; n++) {
             Thread threads[] = new Thread[thread_count];
             long start = System.currentTimeMillis();
             for (int m = 0; m < thread_count; m++) {
              // threads run consecutively, not in parallel
              (threads[m] = new SyncThread()).start();
              threads[m].join();
             long end = System.currentTimeMillis();
             System.out.println("using uncontended sync: " +
                          (end - start) + " ms");
         for (int n = 0; n < 5; n++) {
             Thread threads[] = new Thread[thread_count];
             long start = System.currentTimeMillis();
             for (int m = 0; m < thread_count; m++)
              (threads[m] = new SyncThread()).start();
             for (int m = 0; m < thread_count; m++)
              threads[m].join();
             long end = System.currentTimeMillis();
             System.out.println("using contended sync: " +
                          (end - start) + " ms");
    }

  • File-to-file or File-to-RFC for Automatic PO creation and GR creation

    Hi,
    We are on XI 3.0 and the following has been put to me:
    We will receive a .CSV file from FTP server, into XI and then need to create Purchase Orders followed by the Goods Receipt documents in R/3 based on the incoming data.
    Further to this, the requirement is to give a log of the successfule and failed PO + GR document summary to the business.
    The programme in R/3 will compare the incoming file nmame with archived files already processed and will reject any files with duplicate names.
    I was suggesting to go with the file to RFC in R/3 whereby we can have a Z shell BAPI to include the standard BAPI for PO creation and GR creation. This Z code can then be extended to email the log to the business of which records were successfully created and which failed.
    However, I am stumped as to how can I make the file duplication comparison on R/3 as the incoming file will also be stored on R/3 archive somewhere.
    Can this be made when the BAPI is called in XI?
    I can configure alerts when the BAPI is mapped from incoming file for that interface.
    What was suggested also was to pick up the CSV file and thow it as it is in R/3 and then the Z code can go through it and create the PO and GR objects. However, then it does not make much sense to use XI as the middleware platform.
    Please advice.
    Regards,
    Arcahna

    Hi Archana,
    Take a look to this blog: 
    https://wiki.sdn.sap.com/wiki/display/XI/Different%20ways%20to%20keep%20your%20Interface%20from%20processing%20duplicate%20files
    Maybe it could help you for the duplicate files.
    Regards,
      Juan

  • How to show object creation in UML

    How to show object creation in UML

    In a sequence diagram, it's a line (with arrow) pointing to the new object and the <creates> or <new> tag as mentioned above.
    | obj 1  |
         |
         |    <creates>     ----------
         | -------------->  | obj 2  |
         |                  ----------or----------
    | obj 1  |
         |
         |      <new>       ----------
         | -------------->  | obj 2  |
         |                  ----------

  • Xdb_installation_trigger does not support object creation of type SNAPSHOT

    hi everyone, i'm using Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit on solaris sparc 5.10
    we like to send an email through SSL, and after searching here and there I found out that oracle DB 11g able to go throught the SSL.
    since upgrade our DB to 11g would not be an option, so i tried to export XDB of 11g and import it into XDB 10gR2 schema, it was a mess...
    then i just reinstall XDB using catnoqm.sql & catqm.sql
    and now one of our programmer cant run some script like above
    CREATE MATERIALIZED VIEW FIFSYS_MKT_SCHEME_MV_COY
    TABLESPACE MARKETING_TABLES
    PCTUSED    40
    PCTFREE    10
    INITRANS   2
    MAXTRANS   255
    STORAGE    (
    INITIAL          64K
    MINEXTENTS       1
    MAXEXTENTS       UNLIMITED
    PCTINCREASE      0
    FREELISTS        1
    FREELIST GROUPS  1
    BUFFER_POOL      DEFAULT
    +)+
    NOCACHE
    LOGGING
    NOCOMPRESS
    NOPARALLEL
    BUILD IMMEDIATE
    REFRESH FORCE ON DEMAND
    WITH PRIMARY KEY
    AS
    +/* Formatted on 9/23/2010 1:07:42 PM (QP5 v5.114.809.3010) */+
    SELECT   coy_id,
    appl_branch_id,
    appl_object_code,
    product_type,
    ppdcf_paid_date,
    SUM (scheme_adm) scheme_adm,
    SUM (appl_unit) appl_unit,
    SYSDATE mkt_sysdate
    FROM   (SELECT   NVL (a.coy_id, '01') coy_id,
    a.branch_id appl_branch_id,
    DECODE (a.buss_unit, 'NMC', '2101', 'UMC', '2102', '2352')
    appl_object_code,
    a.platform product_type,
    TRUNC (c.contract_active_date) ppdcf_paid_date,
    NVL (s.ms_amt, 0) scheme_adm,
    NVL (o.total_item, 0) appl_unit
    FROM   ordmgmt.om_trn_appl_ms_lvl_object s,
    ordmgmt.om_trn_appl_hdr a,
    acctmgmt.ar_trn_sum_contracts c,
    +( SELECT appl_no, COUNT ( * ) total_item+
    FROM   ordmgmt.om_trn_appl_object
    GROUP BY   appl_no) o
    WHERE       s.appl_no = a.appl_no
    AND a.appl_no = o.appl_no
    AND s.ms_code IN ('MS03', 'MS14')
    AND c.appl_no = a.appl_no
    AND c.contract_no = a.contract_no
    +/*AND c.office_code = a.branch_id*/+
    AND NVL (a.coy_id, '01') = NVL (c.coy_id, '01'))
    GROUP BY   coy_id,
    appl_branch_id,
    appl_object_code,
    product_type,
    ppdcf_paid_date;
    COMMENT ON MATERIALIZED VIEW FIFSYS_MKT_SCHEME_MV_COY IS 'snapshot table for snapshot MARKETING.FIFSYS_MKT_SCHEME_MV_COY';
    and this error shown:
    ORA-00604 error occurred at recursive SQL level 1
    ORA-20000 Trigger xdb_installation_trigger does not support object creation of type SNAPSHOT
    ORA-06512 at line 32
    maybe some of you know how to solve this problem??
    and, this in the script of the xdb_installation_trigger
    DROP TRIGGER SYS.XDB_INSTALLATION_TRIGGER;
    CREATE OR REPLACE TRIGGER SYS.xdb_installation_trigger
    BEFORE
    CREATE ON DATABASE
    DECLARE
    sql_text varchar2(200);
    val number;
    BEGIN
    if (dictionary_obj_owner != 'XDB') then
    if (dictionary_obj_type = 'FUNCTION' or
    dictionary_obj_type = 'INDEX' or
    dictionary_obj_type = 'PACKAGE' or
    dictionary_obj_type = 'PACKAGE BODY' or
    dictionary_obj_type = 'PROCEDURE' or
    dictionary_obj_type = 'SYNONYM' or
    dictionary_obj_type = 'TABLE' or
    dictionary_obj_type = 'TABLESPACE' or
    dictionary_obj_type = 'TYPE' or
    dictionary_obj_type = 'VIEW' or
    dictionary_obj_type = 'USER'
    +)then+
    if (dictionary_obj_type  != 'PACKAGE BODY'
    +) then+
    sql_text := 'select count(*) from ALL_OBJECTS where owner = :1 and object_name = :2 and object_type = :3';
    execute immediate sql_text into val using dictionary_obj_owner, dictionary_obj_name, dictionary_obj_type;
    if (val = 0) then
    sql_text := 'select count(*) from dropped_xdb_instll_tab where owner = :1 and object_name = :2 and object_type = :3';
    execute immediate sql_text into val using dictionary_obj_owner, dictionary_obj_name, dictionary_obj_type;
    if (val = 0) then
    insert into xdb_installation_tab values
    +(dictionary_obj_owner, dictionary_obj_name, dictionary_obj_type);+
    end if;
    end if;
    end if;
    else
    raise_application_error(-20000, 'Trigger xdb_installation_trigger does not support object creation of type '||dictionary_obj_type);
    end if;
    end if;
    end;
    +/+
    /********************************************************************************/

    i'm so careless, after checking a fresh installation of the same version DB, i dont found xdb_installation_trigger.
    so just by simply remove that trigger & everything works just fine. :)

  • Cost of object creation vs reflection?

    How does the cost of invoking a method using reflection compare to the cost of object creation? Thank you,
    ranko

    i agree. in such cases, you should do the simplest thing that could possibly work. there are legitimate uses for reflection. without reflection, we have no core serialization mechanism. without serialization, we have no core RPC mechanism (RMI). no dynamic proxies without reflection. all those neat visual building tools are hampered without reflection. ORBs and scripting languages like Jython are hindered.
    note that the legitimate uses of reflection shown above tend to be for core JDK, or for development tools. that should be a clue to the developer that unless you're building these kinds of systems, you should reconsider whether reflection is necessary.
    that said, reflection has a high "cool" factor. i think that's what sucks developers toward it. it sucked me in, that's for sure. 8^)
    --p

  • While Loop - Object Creation

    Hello,
    I have a question on object creation and while loops. Have a look at the following code snippet:
    while(true)
           Object obj = new Object();
           // Pass off obj to a new thread
           Thread job = new Thread(new ObjectHandler(obj));
           job.start();
    }My question is, do I have to wait until the newly created Thread is finished with the Object obj before I can create a new Object called obj in the while loop?
    Also does anyone have any documentation on this sort of thing?
    Thanks,
    Tony.

    Jaxie wrote:
    I'm still not sure you get what I'm on about, you might want to read up on java methods and pass by value.I think we know how it works. Most of us have been programming in Java for serveral years.
    >
    When you pass an object to a method in java you pass it a copy of a reference to that object. Leading on from that, before an object is eligible for garbage collection in java, all references to that object must be dropped.
    So with all that in place, my question was, is the creation of an object in a while loop dependent on previous objects of the same name? Objects don't have names. Have we mentioned that before?
    You have a reference, larry that is referencing an unnamed object. You can also create other references that reference the same object. The thread will have one reference. You can then make larry reference another object. That will not change anything in the thread. It will still reference the old object, and that object will not be claimed by the gc until that thread stops referencing it.
    So the second time we go through the loop below, do we have to wait until larry has been garbage collected, before a new larry can be created?Read the articles/tutorials and what I have written above. What do you think?
    Do also note that the GC isn't executed synchronously.

  • Class and Object name change in the universe designer

    Hello Experts
    I have a confusion , I am just wondering if I devlop a bobj universe, lets say, based on SQL database and change the name of the class and object during the creation of the universe, will that fetch the data from d/base properly while running a query / report. Although universe class and object has different names than database now but the records are the same. Do we need to point the object to d/base object in some kind of different or special way .
    To make my question more simple, In d/base table name is "Employee" whereas on universe side I create a class name "Staff" and at the same time field name in the database is "Emploee ID" whereas in the universe I named it "Badge number".
    Please advise if that will make any difference while I run the query or Is there any kind of complication on the universe side that I should expect which I am not familiar with.
    I would apprecite your response.
    Best Regards

    Hello experts,
    Let me rephrase the issue with exact scenario.
    I have a table names "REGION" with fields region id, region and country id.
    I have another table name REGION_SLINE with fields SL_id, region id and Sales_revenue.
    I created an equi join between these two tables based on region id field and checked the cardinality which is ok.
    Now when I try to create a report based on sales revenue per customer ( "customer's first name"  is an other field on CUSTOMER table), I dont get any result in the report and get a message that "No data to reterive"
    Also please note that when I run a report which is sales revenue per region id, I get the result, seem slike these two tables REGION and REGION_SLINE can generate the report but sales revenue per customer report is not generated because customer first name is a field of another table.
    I was just wondering if I need to write some kind of where clause in the object properties of region id which is used to create equi joon link.
    I woulld appreciate your response.
    Regards
    Edited by: SAP_LCCHS on Jul 4, 2011 9:19 AM
    Edited by: SAP_LCCHS on Jul 4, 2011 9:21 AM

  • Use String Variable in New Object Creation

    Thanks to those who review and respond. I am new to Java, so please be patient with my terminoloy mistakes and fumblings. I am reading in a file and I want to create a new object based on specific field (car for example). As you will notice I grab field 8 here label sIID.
    String sIID = dts.group(8);
    BTW this regex grouping works fine. The problem is seen when I try to use the sIID variable in my new object creation process.
    DateParse sIID = new DateParse();
    My IDE is reporting "Variable sIID is already defined in the scope"
    Is this possible? The assumption is that the sIID will have different value during the processing of the file. For example, car could mean truck, sedan, etc with operators like color, number of doors, mileage, top speed, etc.

    Thanks for the reply. I have include similar and much shorter code for the sake of brevity.
    My problems are centered around the x variable/object below. Ideally this would translate to three objects PersonA, PersonB, etc that I could reference later in the code as PersonA.newname if I wanted to. Hopefully this makes sense.
    public class TestingObjects {
      public static void main(String[] argv) {
           String [] names;
           names = new String[3];
           names[0] = "PersonA";
           names[1] = "PersonB";
           names[2] = "PersonC";
           for (String x:names) {
             PN x = new PN();  // <- Problem
             x.name = x;
             x.SayName();
            System.out.println(x.newname);
    public class PN {
           String name;
           String newname;
      public String SayName() {
           newname = "Name = " + name;
           System.out.println(name);
          return newname;
    }

  • Java Object Creation

    A general question about how can Java object creation with an average amount of data retrieval is considered as a reasonable.
    For example if I am clicking on a link in a web application...to paint that page, I think, about 4-5 java object with an average data retrieval of 20 rows wud be considered as appropriate. Any other thoghts or any other parameters to take into consideration?

    If you are concerned about object creation speed, you probably shouldn't. Even my laptop PC can create and garbage collect some 12 million objects per second (10,000,000 objects takes about 800 milliseconds). Test program below; remember to run with "java -server" to get the faster optimizing compiler. For laughs, write an equivalent C++ program that does new&delete in a similar loop.
    public class CreateObject
        public static void main(String args[])
         throws Exception
         for (int m = 0; m < 5; m++)
             doit();
        static void doit()
         long start = System.currentTimeMillis();
         for (int n = 0; n < 10 * 1000 * 1000; n++) {
             new CreateObject();
             new CreateObject();
             new CreateObject();
             new CreateObject();
             new CreateObject();
             new CreateObject();
             new CreateObject();
             new CreateObject();
             new CreateObject();
             new CreateObject();
         long end = System.currentTimeMillis();
         System.out.println((end - start) + " ms");
    }

Maybe you are looking for

  • Actvation problem DSO

    Dear all, we have written some logic in endroutine in transformation, the data floe is datasource->DSO(datasource having 10 fields in DSO we appended one fields to deriving the logic) when run the DTP in new table of the std DSO we are getting the da

  • NullPointerException caused by JFrame.setVisible()

    I'm trying to make a status bar class for use with an app. The code for this class is below. Upon testing the thing i come upon the following exception: Exception in thread "main" java.lang.NullPointerException      at sun.awt.windows.WPanelPeer.rest

  • HT1443 Can I install or purchase a new OS system?

    I am looking to upgrade my OS is that possible?  Can I purchase a newer version because it wont let me download one?

  • What are these folders/files for?

    music > iTunes > Album Artwork > Cache > and then a list of fifteen folders numbered 01,02 to 15, then a further 15 and then some more and some more and then at the end of each path are some .itc files. What's it all about? Is it corrupt and should I

  • How do i live trace without the white background

    Im using cs3 photoshop and illustrator. I want an object lived traced in illustrator without an white background colour. I selected the object and cut it in photoshop and put it in a window with a transparant background, i saved it and opened it in i