Clarification: Varargs and Heap Pollution

My reply -- somewhat late -- to yesterdays [debate on varargs|http://forums.sun.com/thread.jspa?messageID=10941372#10941372].
jduprez wrote:
OK let's approach this with care...
In Java variable arity methods are implemented by boxing into arrays whose types are reified and covariant. Coupled with generics and erasure this opens the door to heap pollution
I don't understand the part I underlined in your statement. Can you clarify it?Well there is a reason one can not construct an array of a non-wildcard parameterized type, the potential for heap pollution:
Whatever<Integer>[] ints = new Whatever<Integer>[1]; // error
Object[] objs = ints;
objs[0] = new Whatever<String>(); // no ArrayStoreException
Whatever<Integer> wi = ints[0]; // no ClassCastException
// sometime much later in unrelated code:
int i = wi.gimme(); // ClassCastException -- where does that come from??Heap pollution is bad and the reason we get an error, it does not compile. However, varargs let you implicitly do, what you can not do explicitly, all you get here is a warning:
<T> T[] makeArray(T... ts) { return ts; }
Whatever<Integer>[] ints = makeArray(new Whatever<Integer>(1));
I don't understand why some here have such an aversion to truth.Seeing George as a poster with a history of helpfulness and good judgment, I'm a bit deterred by this absolute satementWell, my statement was all facts and he answered with :headdesk:; I understand he was just frustrated and I misinterpreted.
You have no problem disagreeing with others' opinions, but when you make a factual error and are corrected then that's outrageous.George might have been more explicit. Maybe he doesn't see the factual error that you corrected in your post - I don't either.He said varargs were not uncharted territory, but -- as explained above -- they are in Java.
Perhaps there is some other way I should be interpreting your response?He might hypothetically have been astonished by what he possibly perceived as a slightly misinformed reply on your part, and didn't care to elaborate on it, as the statement itself was not argumented...
Myself had the (deliberately provoked?) knee-jerk reaction that you were just spelling Fear, Uncertainty, and Doubt in a topic that doesn't really need these;I apologize, I suppose I was just nitpicking and, worst of all, unclear about it; I really should have left it alone.
but as I understand from your posting history that you're interested in memory and generics issues and that you have certainly studied those fields more than I have, I have no doubt that you can explain your position in a more elaborate reply.Thank you, I hope to have done that with this post.
You might be better offf starting a new topic, preferrably in the Java Programming forum, as I suspect that your arguments are a bit too elaborate for "New to java", plus the current topic is already plagued by a lot of off-topic remarks! Absolutely.
With kind regards
Ben

Hello Ben,
thank you for this clarification. I discovered it only today - I added a link in the original discussion.
As stated in the post you linked to, I stumbled on the officially-defined meaning of heap pollution a couple of days after we had this "argument" (until that I had completely mistaken the meaning of this expression), and I edited my reply at that time to open the possibility that, well, you might be right after all...
I stand by my claim that your comment in the other discussion was way too terse to be taken seriously - this new elaboration is very welcome, and proves your point.
As you note, however, the occurence of the problem must have been deemed rare enough that it justified a mere warning instead of banning varrags.
I'd say that removing the warning in 7 is rather unfortunate: rare as it may seem, such a problem is certainly very troublesome to diagnose if we're left with the runtime ClassCastException as the only clue...
Thanks again, and regards.
Jerome

Similar Messages

  • Stack and heap

    What is the difference between stack and heap?

    can we locate the address for heapYes, but you shouldn't want, don't need to and should not even thinking about it.
    A key feature of Java is that you don't use addresses, don't need to worry about them and should aviod using them as they are considered dangerous.
    Java is not like C or machine language and addresses are not a concept which is relevent to Java.
    The closest concept is a reference to an Object. Its actual address is not improtant and can change while the program is running. (In fact it can change every time the garbage collector runs)

  • Lock Timeouts and Heap Space Exhaustion

    I'm having some trouble figuring out the best way to handle resource constraints in my application. Generally speaking, the application works well after starting for about a day or so, but inevitably starts generating "Lock timeout" messages and eventually runs out of heap space.
    Here is the main entity class:
    http://github.com/justindthomas/flower_as/blob/master/src/java/name/justinthomas/flower/analysis/statistics/StatisticalInterval.java
    Here is a supporting, persistent class:
    http://github.com/justindthomas/flower_as/blob/master/src/java/name/justinthomas/flower/analysis/statistics/StatisticalFlow.java
    This is the data accessor:
    http://github.com/justindthomas/flower_as/blob/master/src/java/name/justinthomas/flower/analysis/statistics/StatisticsAccessor.java
    And here is the class that controls the insertion and retrieval of data:
    http://github.com/justindthomas/flower_as/blob/master/src/java/name/justinthomas/flower/analysis/statistics/StatisticsManager.java
    The general flow is that a netflow packet is received from a sensor and the StatisticsManager normalizes the flow as it is inserted into the database. The normalization converts the summarized flow into several "resolutions." For example, one resolution might be 5000 ms. So the StatisticsManager takes the flow's end time/5000 - start time/5000 and divides the volume by the result and inserts that data into the database. It sounds kind of confusing, but results in a dataset that allows me to query for netflow activity for any time frame.
    It also means that the database is queried as it is written to; existing data is updated more frequently than new data is written.
    Regardless, Sleepycat seems to be holding on to more data than it needs to. Once an interval has passed (maybe 5 minutes or so), it is unlikely to be accessed again until queried to create charts. However, the memory usage grows out of control despite the lack of necessity for keeping all but recently entered entries in cache.
    This is how the trouble generally starts (note that I've increased the timeout to 15000 ms to try to accommodate for longer wait times, but that just seems to delay the onset of the issue by a day or so):
    [#|2010-10-23T13:46:00.854-0700|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=64;_ThreadName=Thread-1;|addStatisticalSeconds Failed: (JE 4.0.104) Lock expired. Locker 30264205 -1_pool-6-thread-8_ThreadLocker: waited for lock on database=persist#Statistics#name.justinthomas.flower.analysis.statistics.StatisticalInterval LockAddr:32426808 node=17057517 type=READ grant=WAIT_NEW timeoutMillis=15000 startTime=1287866745448 endTime=1287866760795
    Owners: [<LockInfo locker="29616818 -1_pool-6-thread-5_ThreadLocker" type="WRITE"/>]
    Waiters: [<LockInfo locker="7246740 -1_pool-6-thread-6_ThreadLocker" type="READ"/>, <LockInfo locker="26940477 -1_pool-6-thread-2_ThreadLocker" type="WRITE"/>, <LockInfo locker="5099094 -1_pool-6-thread-4_ThreadLocker" type="READ"/>]
    |#]
    [#|2010-10-23T15:00:41.343-0700|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=65;_ThreadName=Thread-1;|addStatisticalSeconds Failed: (JE 4.0.104) Lock expired. Locker 14184769 -1_pool-6-thread-1_ThreadLocker: waited for lock on database=persist#Statistics#name.justinthomas.flower.analysis.statistics.StatisticalInterval LockAddr:32730917 node=17057517 type=READ grant=WAIT_NEW timeoutMillis=15000 startTime=1287871223679 endTime=1287871241341
    Owners: [<LockInfo locker="23975039 -1_pool-6-thread-8_ThreadLocker" type="WRITE"/>]
    Waiters: [<LockInfo locker="19650664 -1_pool-6-thread-6_ThreadLocker" type="READ"/>]
    |#]
    [#|2010-10-23T15:32:13.090-0700|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=66;_ThreadName=Thread-1;|addStatisticalSeconds Failed: (JE 4.0.104) Lock expired. Locker 17937364 -1_pool-6-thread-7_ThreadLocker: waited for lock on database=persist#Statistics#name.justinthomas.flower.analysis.statistics.StatisticalInterval LockAddr:20265315 node=17057517 type=WRITE grant=WAIT_NEW timeoutMillis=15000 startTime=1287873113904 endTime=1287873133089
    Owners: [<LockInfo locker="3251671 -1_pool-6-thread-1_ThreadLocker" type="WRITE"/>]
    Waiters: [<LockInfo locker="32174859 -1_pool-6-thread-8_ThreadLocker" type="READ"/>, <LockInfo locker="33186148 -1_pool-6-thread-4_ThreadLocker" type="WRITE"/>, <LockInfo locker="17825718 -1_pool-6-thread-2_ThreadLocker" type="READ"/>]
    |#]
    [#|2010-10-23T15:32:13.096-0700|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=64;_ThreadName=Thread-1;|addStatisticalSeconds Failed: (JE 4.0.104) Lock expired. Locker 32174859 -1_pool-6-thread-8_ThreadLocker: waited for lock on database=persist#Statistics#name.justinthomas.flower.analysis.statistics.StatisticalInterval LockAddr:20265315 node=17057517 type=READ grant=WAIT_NEW timeoutMillis=15000 startTime=1287873118064 endTime=1287873133092
    Owners: [<LockInfo locker="3251671 -1_pool-6-thread-1_ThreadLocker" type="WRITE"/>]
    Waiters: [<LockInfo locker="33186148 -1_pool-6-thread-4_ThreadLocker" type="WRITE"/>, <LockInfo locker="17825718 -1_pool-6-thread-2_ThreadLocker" type="READ"/>]
    |#]
    [#|2010-10-23T15:32:13.367-0700|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=67;_ThreadName=Thread-1;|addStatisticalSeconds Failed: (JE 4.0.104) Lock expired. Locker 33186148 -1_pool-6-thread-4_ThreadLocker: waited for lock on database=persist#Statistics#name.justinthomas.flower.analysis.statistics.StatisticalInterval LockAddr:20265315 node=17057517 type=WRITE grant=WAIT_NEW timeoutMillis=15000 startTime=1287873118366 endTime=1287873133366
    Owners: [<LockInfo locker="3251671 -1_pool-6-thread-1_ThreadLocker" type="WRITE"/>]
    Waiters: [<LockInfo locker="17825718 -1_pool-6-thread-2_ThreadLocker" type="READ"/>, <LockInfo locker="25145711 -1_pool-6-thread-6_ThreadLocker" type="READ"/>, <LockInfo locker="5544029 -1_pool-6-thread-5_ThreadLocker" type="READ"/>]
    |#]
    [#|2010-10-23T15:33:14.030-0700|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=68;_ThreadName=Thread-1;|addStatisticalSeconds Failed: (JE 4.0.104) Lock expired. Locker 31602565 -1_pool-6-thread-5_ThreadLocker: waited for lock on database=persist#Statistics#name.justinthomas.flower.analysis.statistics.StatisticalInterval LockAddr:11219992 node=17057517 type=WRITE grant=WAIT_NEW timeoutMillis=15000 startTime=1287873175916 endTime=1287873194019
    Owners: [<LockInfo locker="27649147 -1_pool-6-thread-2_ThreadLocker" type="WRITE"/>]
    Waiters: [<LockInfo locker="3895581 -1_pool-6-thread-7_ThreadLocker" type="WRITE"/>, <LockInfo locker="8345933 -1_pool-6-thread-8_ThreadLocker" type="WRITE"/>, <LockInfo locker="12576013 -1_pool-6-thread-6_ThreadLocker" type="WRITE"/>, <LockInfo locker="5695501 -1_pool-6-thread-1_ThreadLocker" type="WRITE"/>]
    |#]
    [#|2010-10-23T15:33:23.334-0700|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=64;_ThreadName=Thread-1;|addStatisticalSeconds Failed: (JE 4.0.104) Lock expired. Locker 8345933 -1_pool-6-thread-8_ThreadLocker: waited for lock on database=persist#Statistics#name.justinthomas.flower.analysis.statistics.StatisticalInterval LockAddr:11219992 node=17057517 type=WRITE grant=WAIT_NEW timeoutMillis=15000 startTime=1287873184851 endTime=1287873203333
    Owners: [<LockInfo locker="3895581 -1_pool-6-thread-7_ThreadLocker" type="WRITE"/>]
    Waiters: [<LockInfo locker="12576013 -1_pool-6-thread-6_ThreadLocker" type="WRITE"/>, <LockInfo locker="5695501 -1_pool-6-thread-1_ThreadLocker" type="WRITE"/>, <LockInfo locker="13327115 -1_pool-6-thread-4_ThreadLocker" type="READ"/>, <LockInfo locker="11939897 -1_pool-6-thread-5_ThreadLocker" type="READ"/>]
    |#]
    [#|2010-10-23T15:33:23.344-0700|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=69;_ThreadName=Thread-1;|addStatisticalSeconds Failed: (JE 4.0.104) Lock expired. Locker 12576013 -1_pool-6-thread-6_ThreadLocker: waited for lock on database=persist#Statistics#name.justinthomas.flower.analysis.statistics.StatisticalInterval LockAddr:11219992 node=17057517 type=WRITE grant=WAIT_NEW timeoutMillis=15000 startTime=1287873184893 endTime=1287873203343
    Owners: [<LockInfo locker="3895581 -1_pool-6-thread-7_ThreadLocker" type="WRITE"/>]
    Waiters: [<LockInfo locker="5695501 -1_pool-6-thread-1_ThreadLocker" type="WRITE"/>, <LockInfo locker="13327115 -1_pool-6-thread-4_ThreadLocker" type="READ"/>, <LockInfo locker="11939897 -1_pool-6-thread-5_ThreadLocker" type="READ"/>]
    |#]
    Those errors go on and on and on, until I eventually see this:
    [#|2010-10-23T17:37:29.876-0700|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=71;_ThreadName=Thread-1;|Exception in thread "ContainerBackgroundProcessor[StandardEngine[com.sun.appserv]]" |#]
    [#|2010-10-23T17:37:34.915-0700|INFO|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=23;_ThreadName=Thread-1;|In main loop, we have serious trouble: java.lang.OutOfMemoryError: Java heap space|#]
    [#|2010-10-23T17:37:56.516-0700|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=66;_ThreadName=Thread-1;|Exception in thread "pool-6-thread-7" |#]
    [#|2010-10-23T17:39:11.060-0700|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=23;_ThreadName=Thread-1;|Exception in thread "{felix.fileinstall.poll=5000, felix.fileinstall.bundles.new.start=true, service.pid=org.apache.felix.fileinstall.fd8877ce-71aa-41d2-8ddc-15ce996cde1b, felix.fileinstall.dir=/opt/glassfishv3/glassfish/domains/domain1/autodeploy/bundles/, felix.fileinstall.filename=org.apache.felix.fileinstall-autodeploy-bundles.cfg, service.factorypid=org.apache.felix.fileinstall, felix.fileinstall.debug=1}" |#]
    [#|2010-10-23T17:39:11.070-0700|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=66;_ThreadName=Thread-1;|java.lang.OutOfMemoryError: Java heap space
         at java.util.IdentityHashMap.init(IdentityHashMap.java:261)
         at java.util.IdentityHashMap.<init>(IdentityHashMap.java:207)
         at com.sleepycat.je.utilint.IdentityHashMap.<init>(IdentityHashMap.java:25)
         at com.sleepycat.je.cleaner.LocalUtilizationTracker.<init>(LocalUtilizationTracker.java:39)
         at com.sleepycat.je.recovery.Checkpointer.flushDirtyNodes(Checkpointer.java:665)
         at com.sleepycat.je.recovery.Checkpointer.syncDatabase(Checkpointer.java:604)
         at com.sleepycat.je.dbi.DatabaseImpl.sync(DatabaseImpl.java:977)
         at com.sleepycat.je.dbi.DatabaseImpl.handleClosed(DatabaseImpl.java:863)
         at com.sleepycat.je.Database.closeInternal(Database.java:458)
         at com.sleepycat.je.Database.close(Database.java:314)
         at com.sleepycat.je.SecondaryDatabase.close(SecondaryDatabase.java:331)
         at com.sleepycat.persist.impl.Store.closeDb(Store.java:1454)
         at com.sleepycat.persist.impl.Store.close(Store.java:1059)
         at com.sleepycat.persist.EntityStore.close(EntityStore.java:630)
         at name.justinthomas.flower.analysis.persistence.FlowReceiver.addFlow(FlowReceiver.java:94)
         at name.justinthomas.flower.analysis.persistence.FlowReceiver.addFlow(FlowReceiver.java:65)
         at name.justinthomas.flower.collector.FlowWorker.parseData(FlowWorker.java:382)
         at name.justinthomas.flower.collector.FlowWorker.v9(FlowWorker.java:111)
         at name.justinthomas.flower.collector.FlowWorker.run(FlowWorker.java:61)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
         at java.lang.Thread.run(Thread.java:636)
    |#]
    [#|2010-10-23T17:39:11.124-0700|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=23;_ThreadName=Thread-1;|java.lang.OutOfMemoryError: Java heap space
    |#]
    [#|2010-10-23T17:39:11.141-0700|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=72;_ThreadName=Thread-1;|Exception in thread "pool-6-thread-3" |#]
    [#|2010-10-23T17:39:11.144-0700|SEVERE|glassfish3.0.1|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=72;_ThreadName=Thread-1;|java.lang.OutOfMemoryError: Java heap space
    |#]
    It's very frustrating, because things run so well at first and then just deteriorate into a resource nightmare. Any suggestions would be welcome. The application is running with 3 CPU cores and 2GB RAM.
    Edited by: justindthomas on Oct 23, 2010 7:19 PM: I initially tried to use the forum's "URL" mechanism, but that doesn't seem to work worth anything, so I un-did it.

    I've disabled that thread for now. While debugging that, I ran into a SecondaryIntegrityException and I read that I shouldn't use secondary indexes without also using transactions. I enabled transactional processing, but the locking issues grew far worse. I opted to find ways to not use secondary indexes instead.You're right that with secondaries it is important to use txns. But I'm not sure why you're having such severe locking problems with txns. Were you using a txn with a cursor, to perform a scan? If so, I can probably suggest ways of doing that without the txn, if you can describe what you're doing and/or point me to your source code. Or, perhaps you've decided not to use secondaries, and this isn't an issue anymore?
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • SAP Note #723909 Clarification needed: 2G heap for server nodes

    We mare upgrading from Enterprise 4.7 to ERP 6.0 SP12. For our ESS/MSS we will use standalone Java NW 7.0 SP14 with XSS SP12. Our portal servers and ERP ABAP are Unix Solaris 9 or 10 64-bit. The portal servers are 4CPU x 16G. We use three server nodes on our central instance and three server nodes on our dialog instance.  All server nodes have 2G heap.
    Recent load tests indicate we are reaching memory limits in the server nodes. THis causes frequent full GC with tenured objects deleted (very time consuming). We want to increase heap size > 2GB.  Note 723909 seems to say this can be done for 64-bit systems, but SAP appears to recommend additional server nodes with 2G heap. I think this is because of GC performance with large heap.
    - Are we supported with heap > 2G?
    - Are there still concerns with GC when heap > 2G?
    - Are there other reasons why heap should be no higher than 2G?
    Thanks in advance

    - Are we supported with heap > 2G?
    - Are there still concerns with GC when heap > 2G?
    - Are there other reasons why heap should be no higher than 2G?
    You´ve answered your questions yourself
    To have a fast J2EE engine you need to absolutely make sure all the heap is covered in physical memory. No swapping should take place at all. Once the system starts swapping in and out, you will loose a lot of performance.
    How big is your Oracle SGA? If you can decrase it so all the heaps (+ dispatcher heap) will fit in physical memory you can increase more. We use 2.5 - 3 GB heap (for BI) with three server nodes.
    Markus

  • Roll, extended and heap memory EXTM

    hi Dear,
    I am getting issue performance issue one new server while the system specs is:
    *Processor 2 *  x3690 X5, Xeon 8C E7-2820 105W 2.00GHz
    Cache  18MB L3
    Memory (Installed)  32 GB PC3L-10600 CL9 ECC DDR3 1333MHz
    Instance Profile
    Parameter Name                              Parameter value
    em/initial_size_MB                          12288
    ztta/roll_extension                         2000683008
    abap/swap_reserve                           20971520
    abap/heaplimit                              40894464
    abap/heap_area_total                        15204352000
    abap/heap_area_nondia                       0
    abap/heap_area_dia                          2000683008
    rdisp/PG_MAXFS                              32768
    rdisp/PG_SHM                                16384
    rdisp/ROLL_MAXFS                            32768
    rdisp/ROLL_SHM                              32768
    ztta/roll_area                              3000320
    ztta/roll_first                             1024
    rsdb/ntab/sntabsize                         9631
    rsdb/ntab/irbdsize                          19261
    rsdb/ntab/ftabsize                          96305
    rsdb/ntab/entrycount                        64167
    zcsa/presentation_buffer_area               14640128
    rsdb/cua/buffersize                         8000
    rtbb/buffer_length                          90000
    zcsa/table_buffer_area                      30000000
    abap/buffersize                             1500000
    PHYS_MEMSIZE                                18432
    login/no_automatic_user_sapstar             1
    login/password_history_size                 5
    login/fails_to_user_lock                    5
    rsdb/obj/buffersize                         40000
    rdisp/wp_no_dia                             12
    rdisp/wp_no_btc                             3
    rdisp/wp_no_enq                             1
    rdisp/wp_no_vb                              2
    rdisp/wp_no_vb2                             1
    rdisp/wp_no_spo                             2
    rsdb/obj/max_objects                        2500
    rdisp/max_wprun_time                        2400
    would you give me your expert Suggestion with respect to system Specs(Processor_8C and RAM_32gb)
    Regards,

    hi Gaurav,
    1) When this dump occurs , ( during specific activity or anytime).
    Dump is occurring against specific transaction when users are executing tcode with big selection criteria.
    System:                  PRDSAP_PRD_00             Tune summary
    Date + Time of Snapshot: 21.02.2012    09:37:21    Startup:     19.02.2012 22:05:14
    Buffer             HitRatio %  Alloc. KB Freesp. KB % Free Sp. Dir. Size FreeDirEnt % Free Dir    Swaps  DB Accs
    Nametab (NTAB)                                                                                0
      Table definition     86.81     21,809                          64,167                        127,586  192,179
      Field definition     77.90    101,318     45,098      46.83    64,167     50,613      78.88  109,591  123,279
      Short NTAB           98.44     11,636      8,958      93.01    16,041     13,391      83.48        0    2,650
      Initial records       0.99     21,266     14,669      76.16    16,041      2,860      17.83   53,460   66,641
                                                                                    0
    program                96.73  1,500,000    795,367      57.04   375,000    305,187      81.38        0  209,493
    CUA                    99.30      8,000      3,129      47.71     4,000      3,754      93.85        0      252
    Screen                 99.59     14,297      9,503      67.43     2,000      1,731      86.55        0      275
    Calendar              100.00        488        366      76.57       200         48      24.00        0      152
    OTR                   100.00      4,096      3,375     100.00     2,000      2,000     100.00        0
                                                                                    0
    Tables                                                                                0
      Generic Key          99.73     29,297      2,399       8.65     5,000      1,611      32.22       39   14,181
      Single record        88.77     90,000     51,599      57.45       500        403      80.60        0   72,187
                                                                                    0
    Export/import          92.43     40,000     34,517      88.28     2,500        975      39.00        0
    Exp./ Imp. SHM         53.57      4,096      3,203      94.90     2,000      1,999      99.95        0
    SAP Memory      Curr.Use % CurUse[KB] MaxUse[KB]  In Mem[KB] OnDisk[KB] SAPCurCach HitRatio %
    Roll area            0.12        325      3,488     262,144          0   IDs           98.77
    Page area            0.25        666     94,624     131,072    131,072   Statement     93.00
    Extended memory      4.03    675,840  6,881,280  16,773,120          0                  0.00
    Heap memory                        0  1,084,762           0          0                  0.00
    Call Stati     HitRatio % ABAP/4 Req ABAP Fails DBTotCalls AvTime[ms]  DBRowsAff.
    Select single     99.84  1,755,375    267,018      9,898          0   1,488,357
    Select             1.53  1,471,444          0    561,166          0   5,708,457
    Insert             0.00    225,271      5,926     58,267          0   4,146,957
    Update             0.00        497         25        572          0         507
    Parameters of SWAP entries
    Efficiency        HITRATIO          %        87
                       HITS                1,264,801
                       REQUESTS            1,456,982
                       DB access quality %        87
                       DB access             192,179
                       DB access saved     1,264,787
                       Reorgs                      0
    Size              Allocated        KB    21,809
                       Available        KB    18,297
                       Used             KB    18,297
                       Free             KB         0
                       Free             KB         0
    Directory entries Available              64,167
                       Used                   64,167
                       Free                        0
    Swaps             Objects swapped       127,586
                       Frames swapped              0
    Resets            Total                       0
    you can check the starting date of above server while there are some users are login on this server for data testing.
    would you suggest me the value of above parameters?
    Regards,
    Regards,

  • NetBeans and Heap Size

    I'm trying to write a program using NetBeans and I keep getting OutOfMemoryErrors. I have 2GB of RAM and I've attempted to modify the netbeans.conf file to increase the heap size at startup. The changes I've made aren't being reflected in the memory manager tool (it still indicates a maximum size of ~50MB). The pertinent code from the config file is as follows:
    netbeans_default_options="-J-Xms512m -J-Xmx1024m -J-XX:PermSize=128m -J-XX:MaxPermSize=512m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-XX:NewSize256m"
    Assuming my memory usage won't exceed these limits, any suggestions as to how to make sure the changes are being implemented?

    I would subscribe to the netbeans user mail list, and pose your question to that list. The Sun Netbeans gurus live there.
    I would also use a seperate email account to subscribe to the list as it generates alot of messages daily. If thats not an option, definatly try to set up a rule that seperates messages from the list from your regular email.
    The main netbeans top level mail list web page is here with all the instructions to subscribe and unsubscribe.
    Good luck,
    JJ

  • Relationship between Dynamic Memory Heap and Heap Data Structure

    This question is not strictly related to Java, but rather to programming in general, and I tend to get better answers from this community than any where else.
    Somehow, my school and industry experience have somehow not given me the opportunity to explore and understand heaps (the data structure), so I'm investigating them now, and in particular, I've been looking at applications. I know they can be used for priority queues, heap sorts, and shortest path searches. However, I would have thought that, obviously, there must be some sort of relationship between the heap data structure, and the dynamic memory heap. Otherwise, I can think of no good reason why the dynamic memory heap would be named "heap". Surprisingly, after searching the web for 90 minutes or so, I've seen vague references, but nothing conclusive (trouble seems to be that it's hard to get Google to understand that I'm using the word "heap" in two different contexts, and similarly, it would not likely understand that web authors would use the word in two different contexts).
    The Java Virtual Machine Spec is silent on the subject, as "The Java virtual machine assumes no particular type of automatic storage management system, and the storage management technique may be chosen according to the implementor's system requirements."
    I've seen things like:
    [of dynamic memory] "All the blocks of a particular size are kept in a sorted linked list or tree (I extrapolate that sorted tree could imply heap)"
    [of dynamic memory] "The free and reserved areas of memory are maintained in a data structure similar to binary trees called a heap"
    [of dynamic memory] "This is not related to the heap data structure"
    [of dynamic memory] "Not to be confused with the data structure known as a "heap"
    [of data structure] "Not to be confused with the dynamic memory pool, often known as TheHeap"
    At this point, I've come to surmise that some (but not all) memory management algorithms use heaps to track which (pages? blocks? bytes?) of memory are used, and which are not. However, the point of a heap is to store data so that the max (or min) key is at the root of the heap. But we might want to allocate memory of different sizes at different times, so it wouldn't make sense to key on the amount of available memory in a particular region of the free store.
    I must assume then that there would be a different heap maintained for each size of memory block that can be allocated, and the key must have something to do with the attractiveness of the particular memory block in the heap (perhaps the lowest address, resulting, hopefully, in growing the free store space less often, leaving more space for the stack to grow, or perhaps keyed based on the fragmentation, to hopefully result in less fragmentation, and therefore more efficient use of the memory space, or perhaps based on page boundaries, keeping as much data in the same page as possible, etc).
    So at this point, I have a few questions I've been unable to resolve completely:
    1. Am I correct that the heap was so named because (perhaps at one point in time), a heap is/was commonly used to track the available memory in the free store?
    2. If so, would it be correct that there would be a heap per standard block size?
    3. Also, at what level of granularity would a heap typically be used (memory page, memory blocks, individual words (4-bytes))?
    4. What would be the most likely property one would use as a key. That is, what makes the root item on the heap ideal?
    5. Would a industrial strength system like the jvm use a (perhaps modified or tuned) heap for this sort of task, or would this typically be too naive for an real world solution today?
    Any insight would be awesome!
    Thanks,
    A.

    jschell wrote:
    I think you are not only mixing terms but domains.
    For starters the OS allocs memory. Applications, regardless of language, request memory from the OS and use it in various ways.
    There are many variations of the term "heap" like the following.
    [http://en.wikipedia.org/wiki/Heap_(data_structure)]
    [http://en.wikipedia.org/wiki/Dynamic_memory_allocation]
    A java VM will request memory from the OS (from a 'heap') and use it in its application 'heap' (C/C++) and then create the Java 'heap'. There can be variations of that along the way that can and likely will include variations of how each heap is used, potentially code that creates its own heap, and potentially other allocators which use something which is not a heap.This last part, I find a bit confusing. By "use something which is not a heap", do you mean the heap data structure, or the dynamic memory pool meaning of heap? If the former, then you would be implying that it would be common for a heap data structure to be used to manage the heap dynamic memory pool. If the latter, what would this "something which is not a heap" be? The best definition of "heap" I've found simply states that it is a pool of memory that can be dynamically allocated. If there is some other way of allocating dynamic memory, then it would suggest that the previous definition of "heap" is incomplete.
    >
    So to terms.
    1. Am I correct that the heap was so named because (perhaps at one point in time), a heap is/was commonly used to track the available memory in the free store?Which 'heap'? The VM one? It is probably named that because the implementors of the Sun VM were familar with how C++ and Smalltalk allocated memory.Okay, but that begs the question, was the heap in C++ and/or Smalltalk so named for the above queried reason?
    >
    2. If so, would it be correct that there would be a heap per standard block size?Not sure what you are referring to but probably a detail of the implementation. And since there are different levels the question doesn't mean much.
    However OS allocations are always by block if that helps. After that it requires making the question much, much more specific.
    3. Also, at what level of granularity would a heap typically be used (memory page, memory blocks, individual words (4-bytes))?Again not specific enough. A typical standard implementation of heap could not be at the word level. And it is unlikely, but not impossible, that variations would support word size allocations.
    The VM heap might use word boundaries (but not size), where the application heap certainly does (word boundary.)My understanding of it is that the application would request blocks from the OS, and then something like malloc would manage the memory within the allocated blocks. malloc (or whatever equivalent Java uses) would have to keep track of the memory it has allocated somehow, and I would think it would have to do this at the word level, since it's most commonly going to allocate memory at the word level to be references to other objects, etc.
    So I guess my question here would really be, if the dynamic memory heap is so named because there has been a memory management strategy that relied upon a heap data structure (which I've found no proof, but have found some suggestive literature), then would that probably have applied at the OS Page Fault level, tracking allocated blocks, or would that have applied at the malloc level, allocating individual words as necessary?
    >
    4. What would be the most likely property one would use as a key. That is, what makes the root item on the heap ideal?"Key" is not a term that will apply in this discussion.
    You appear to be referring to strategies for effective allocation of memory such as allocations from different regions by size comparison.
    It is possible that all levels might use such an allocator. General purpose applications do not sort allocations though (as per your one reference that mentions 'key'.) Sorry, I got the term "key" from an article I read regarding heaps, that indicates that a "key" is used to sort the elements, which I guess would be a more generalized way to make a heap than assuming a natural ordering on the elements in the heap. I'm not sure if the terminology is standard.
    >
    5. Would a industrial strength system like the jvm use a (perhaps modified or tuned) heap for this sort of task, or would this typically be too naive for an real world solution today?Again too indefinite. The Sun VM uses a rather complicated allocator, the model for which originated after years of proceeding research certainly in Smalltalk and in Lisp as well, both commercially and academically.
    I am sure the default is rules driven either explicitly or implicitly as well. So it is self tuning.
    There are command line options that allow you to change how it works as well.I guess perhaps I could attempt to clarify my initial question a bit.
    There is a 1:1 correspondence between the runtime stack, and a stack data structure. That is, when you call a function, it pushes a stack frame onto the runtime stack. When you return from a function, it pops a stack frame from the runtime stack. This is almost certainly the reasons the runtime stack is named as it is.
    The question is, is there or has there ever been a 1:1 correspondence between some aspect of the dynamic memory heap or how it is managed, and a heap data structure? If so, it would explain the name, but I'm a bit puzzled as to how a heap data structure would be of assistance in creating or managing the dynamic memory heap. If not, on the other hand, then does anybody know where the name "heap" came from, as it applies to the dynamic memory pool?
    A.

  • NT Service and Heap size

    Can someone tell me if there is a way to :
    (1) verify and modify heap size in nt service?
    (2) in multi server mode, there are two nt services for weblogic
    domains, is it needed to change heap size for weblogicAdmin service for
    heap size increase? What will happen if PIA is 1024MB heap size and
    weblogicAdmin is 256MB?
    Thanks in advance/T

    Nicolas, test show that once the nt service is installed, modifying heap
    size in setenv.cmd and run setenv.cmd file reinstall nt service does not
    change the heap size already in registry. So, test shows that I can
    modify the heap size directly in registry and restart service?. Am i doing something wrong here.. can i correct and only to modify and existing heap size in
    registry?
    Please let me know what else should I do once the old heap
    size in already in registry and not the new heap size when reinstalled NT service.
    other question, long the weblogic tuning, I found the following from bea site. During the peak time, we may have 40000 unique users per day. Should I also consider increase maxUserPort? The weblogic domains are hosted on windows 2003 servers.
    Windows Tuning Parameters
    For Windows platforms, the default settings are usually sufficient. However, under sufficiently heavy loads it may be necessary to adjust the MaxUserPort and TcpTimedWaitDelay. These parameters determine the availability of user ports requested by an application.
    By default, ephemeral (that is, short-lived) ports are allocated between the values of 1024 and 5000 inclusive using the MaxUserPort parameter. The TcpTimedWaitDelay parameter, which controls the amount of time the OS waits to reclaim a port after an application closes a TCP connection, has a default value of 4 minutes. During a heavy loads, these limits may be exceeded resulting in an address in use: connect exception. If you experience address in use: connect exceptions try setting the MaxUserPort and TcpTimedWaitDelay registry values under the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters key:
    MaxUserPort = dword:00004e20 (20,000 decimal)
    TcpTimedWaitDelay = dword:0000001e (30 decimal)
    Increase the value of the MaxUserPort parameter if the exception persists.
    For more information about Windows 2000 tuning options, see:
    § The Microsoft Windows 2000 TCP/IP Implementation Details.
    § The Windows 2000 Performance Tuning white paper.
    thanks
    T

  • Full- GC before Old Gen is filled up - Old gen 1.7 GB and heap is 2.4 GB.

    I am having a very unique problem with the Sun JVM that I am using.
    Here is the JVM start-up paramaters.
    /opt/bea/bea814/jdk142_05/bin/java -server -Xms2560m -Xmx2560m -XX:NewRatio=2 -XX:PermSize=128m -XX:MaxPermSize=512m -XX:SurvivorRatio=6 -XX:+DisableExplicitGC -XX:+UseParNewGC -Djava.security.policy=/opt/bea/bea814/weblogic81/server/lib/weblogic.policy weblogic.Server
    Per the start-up, it should use the 1.7 GB of space for the old gen. However, what I see is when the Old gen never goes above the 1.3 GB, before that it requests for the full-gc which takes quiet a long to clean it up. Could someone using so much high Heap share their experiences.
    I checked the docs and it says that:
    Why can't I get a larger heap with the 32-bit JVM?
    The maximum theoretical heap limit for the 32-bit JVM is 4G. Due to various additional constraints such as available swap, kernel address space usage, memory fragmentation, and VM overhead, in practice the limit can be much lower. On most modern 32-bit Windows systems the maximum heap size will range from 1.4G to 1.6G. On 32-bit Solaris kernels the address space is limited to 2G. On 64-bit operating systems running the 32-bit VM, the max heap size can be higher, approaching 4G on many Solaris systems.

    Since you are using JDK-1.4.2, I suspect you are running into the "full promotion guarantee", in which a young generation collection won't run if it it can't be sure that all the live data in the young generation can be promoted to the old generation. With a 2.5GB heap with a young generation about 1/2 the size of the old generation, and the survivor spaces you have configured, I suspect that happens when the old generation has about 1.3GB of stuff in it. In JDK-1.4.2, when the young generation collector decides it can't meet that guarantee, it just hands off to a full collection.
    You could move to a more recent JDK in which the full promotion guarantee has been considerably relaxed, so that full collections only happen if there isn't room for what you are promoting out of the young generation. Moving to a more recent JDK would also give you the option of using either a parallel collector to make the full collection pauses take less time, or using a concurrent collector to hide the collection time in spare cycles on your machine. Which collector to use would depend on the hardware you have, and your needs for low-latency or high-throughput.
    If you can't move off of JDK-1.4.2, you could try making your young generation smaller, so that all of it represents less of the old generation, and leaves more room in your address space for your old generation. That would give you more frequent, but likely shorter, young generation collections, and probably stretch the time between full collections.
    One correction: on a 32-bit Solaris system, you get 4GB of address space for your process, and can get 3.5GB (or so) for the Java object heap. Of course you want to make sure you have physical memory to hold the heap.

  • Difference between Stack and Heap?

    Are Java objects created on stack or heap?
    What's the difference?

    Stack
    *this lives in the general RAM.
    *this is an extremly fast and efficient way to allocate storage.
    *it has direct support from the processors via stack pointer.
    *while it is creating the program exact size and lifetime of all the datathat is stored on the                   stack.
    Heap
    *this is a general purpose pool of memory(also in the RAM).
    *thus there is a great deal of flexiblity in using storage on the heap.
    *it takes more time to allocate heap storage.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • I backup my phone to my mac and heaps of my old photos came back and now i can't delete them HELP?!

    i can't delete my photos after contacting to my mac

    Do you mean, you connected the iPhone to your mac and imported the photos to iPhoto or the Photos.app?  And the import panel does not let you delete the photos from your device after importing?
    Then you have probably iCloud Photo Library Beta enabled on the phone. In that case you have to delete the photos directly on the device and cannot delete them from the import panel.

  • IPTC clarification: Aperture and IPhoto

    I'd like to be sure I am right about the following info.
    IPTC.Headline
    transfers to Aperture->Headline
    does not transfer to iPhoto
    IPTC.ObjectName
    transfers to Aperture->ObjectName
    transfers to iPhoto->Title
    I am preparing my photos for transfer from another application, and I'm trying to maximize the transfer.
    Thank you -
    Marion in NY

    I'd like to be sure I am right about the following info.
    IPTC.Headline
    transfers to Aperture->Headline
    does not transfer to iPhoto
    IPTC.ObjectName
    transfers to Aperture->ObjectName
    transfers to iPhoto->Title
    I am preparing my photos for transfer from another application, and I'm trying to maximize the transfer.
    Thank you -
    Marion in NY

  • PX Feature clarification (Snapshots) and Crypto Ransomware

    Hello,
    I am trying to better understand the "Snapshots" feature of the Lenovo PX2 series NAS devices.  I currently have a px2-300d (with latest firmware).  I have inquired over the phone, but the person I spoke with did not provide a definitive answer.
    I would like my PC workstation backups to be protected from Cryptolocker-like malware, however, we do not want to use a cloud based backup system (which does protect against Crypto Ransomware).  As you may know, Cryptolocker, and similar malware, can encrypt, or corrupt, all files acccessible from the PC/workstation, including network backup locations containing backups.
    I would like to know if the "Snapshots" feature of the PX2 NAS devices would provide adequate protection against this.  Additionally, I would like instructions for properly setting up that feature to provide the necessary protection.  If the "Snapshots" feature does not provide protection, I'm looking for other suggestions or solutions to the problem that can be used with these NAS devices.
    Thanks, in advance, for your time and help.
    Regards,
    Bob
    Solved!
    Go to Solution.

    Hello ohbobva
    With px devices you can manage how much of the storage pool is used for specific tasks.  
    With a default configuration on a px2 it would be RAID1 across the disks creating a single storage pool.  This is the storage pool listed under all features>drive management.  
    The portion of the storage pool that is blue is allocated, the white portion is unallocated.  
    Under the storage pool name there will be a "Volumes" section, this will list the different typs of volumes that are using the allocated space.
    The default is a share volume and usually a portion of the storage pool is allocated (reserved) for that volume's use.  iSCSI LUNs(drives) and Snapshots would be other types of volumes that can allocate(reserve) the storage pools unallocated space
    If you have a share volume that you want to use snapshots with and it is 2TB in size you would want to allow 2 TB of unallocated space to be available when setting up the Snapshot.
    With what your are trying to do, having a 45/45/10 allocation would be best.  45% of the storage pool allocated for the Share volume, 45% for the Snapshots, and 10% left unallocated for the firmware to maintain the storage pool and volumes efficiently. 
    Again this should not be consided a backup, but more of a volume level fault tolerance. 
    LenovoEMC Contact Information is region specific. Please select the correct link then access the Contact Us at the top right:
    US and Canada: https://lenovo-na-en.custhelp.com/
    Latin America and Mexico: https://lenovo-la-es.custhelp.com/
    EU: https://lenovo-eu-en.custhelp.com/
    India/Asia Pacific: https://lenovo-ap-en.custhelp.com/
    http://support.lenovoemc.com/

  • How to find the HEAP and CHUNK of memory in Oracle

    hi,
    Intermitently I'm getting some ora-00600 errors that indicate corruption in some heaps and chunks, as follow:
    Repeat 79 times
    Chunk 3e05a198 sz= 0 ERROR, BAD MAGIC NUMBER (0)
    Dump of memory from 0x3E059198 to 0x3E05B198
    3E059190 00000000 00000000 [........]
    3E0591A0 00000000 00000000 00000000 00000000 [................]
    and
    HEAP DUMP heap name="CCursor" desc=367B4F18
    extent sz=0x424 alt=32767 het=16 rec=9 flg=2 opc=0
    parent=03C38510 owner=3E46E22C nex=00000000 xsz=0x424
    EXTENT 0 addr=3E05A190
    ERROR extent at 3E05A190 contains wrong ds 00000000
    How do I find those heaps and chunks corrupted and how to fix it ?
    Any tips will be very usefull
    Regards

    The only way to "fix" the corrupted memory is to login to MetaLink, use the ORA-600 lookup tool to see if there is any info on the particular ORA-600 you encountered. If so, find out if there is a patch or workaround available. If the lookup tool doesn't turn up anything, open an SR and work with Oracle support for resolution.
    As far as the corruption that has already occurred, well, if it's only in memory (which is the most likely case) then there's really nothing you can do to fix it. If it caused on-disk corruption, then you'll need to restore/recover from a recent backup.
    Hope that helps,
    -Mark

  • Need Clarification On Unicode and Upgrade-ECC6.0

    Dear All,
    I need some clarification unicode and upgrade . It would be great help if you give your time .
    We had 2 code pages - 1100,1401 in 4.6B system. We had languages - FR,EN,ES,PT and PL. The system has been upgraded to ECC6.0 non-unicode now.
    Now in I18N->System configuration (RSCPINST), only EN is listed. SPUMG asked for activation of I18N to proceed. When the I18N activation was done,  it has knocked out the code page 1401 from TCPDB table.
    Is this normal?
    But, the code pages 1401 is shown as consistent in SCP transaction.
    The system setting has changed to Single code page. Will this affect unicode migration? How did the additonal code page 1401 which was in 4.6B get knocked out
    now? How did the languages ES,FR,PT, IT and PL which were in 4.6B get knocked out of RCPINST?
    We are manually filling the vocabulary since SPUMG is not showing Scanning tabs. The language key in vocabulary is not completely set. The reprocess logs are not completely green. Will this allow unicode migration now? Can we start unicode migration even with this status.
    Regards,
    Santosh
    Edited by: santosh suryavanshi on Nov 18, 2010 11:11 PM
    Edited by: santosh suryavanshi on Nov 18, 2010 11:11 PM

    Hi Santosh,
    SAP ECC 6.0 is not supported with MDMP. This is the reason for the behaviour in RSCPINST.
    The standard way for an upgrade based on start release 4.6B with MDMP would be TU&UC (see SAP note 959698).
    Do you follow this procedure ?
    Best regards,
    Nils Buerckel
    SAP AG

Maybe you are looking for

  • OIM 11.1.1.5: Post Process Event Handler, change password notification

    Hi, Products OIM 11.1.1.5 BP02 OAM 11.1.1.5 OID 11.1.1.5 Problem I have written a post-process event handler which fires when a role is assigned to a user. The event handler calls a plugin which uses the UserManager API to generate and change the use

  • KeyListeners don't work

    Hi, I'm trying to add a KeyListener to the component JApplet which is able to catch all KeyEvents that occur. My aim is to write an applet that intercepts all keyboard events taking place on any component that it contains. But so far it doesn't work.

  • ABAP going to be obsolated soon?

    DEAR  EXPERTS,    I  have  heard  a  very  shocking  news, actually it's  a  rumour  I  think ,  that  ABAP  is  going  to  be  obsolated  in  the  near  future  and   will  be  replaced  by  JAVA. IF  that's  the  case,  then  what  would  be  the 

  • About the canvas color

    Hiii, i had made a visual attribute, changing the background color property at runtime by set_va_property(). suppose i am changing the background color value R0G0B100 by set_va_property(). when this value set at design time of visual attribute gives

  • Can't expand Mac OS Update - Corrupted.

    for the last week. I have been getting a message that the update is corrupted when it expands... Thoughts?