Binary memory calculator on near cahce

I am trying to cap cache size on client using near cache.
     <near-scheme>
               <scheme-name>extend-near</scheme-name>
               <front-scheme>
                    <local-scheme>
                         <high-units>500M</high-units>
                         <unit-calculator>BINARY</unit-calculator>
                    </local-scheme>
               </front-scheme>
               <back-scheme>
                    <remote-cache-scheme>
                         <scheme-ref>extend-dist</scheme-ref>
                    </remote-cache-scheme>
               </back-scheme>
               <invalidation-strategy>all</invalidation-strategy>
          </near-scheme>
with above configuration i see this exception
java.lang.IllegalArgumentException: Unsupported key or value: Key=1269, Value=com.starwood.valhalla.sherlock.dto.PropertyContentType@19be19be
In cache, key is integer and value is java bean. As per doc, both supposed to be [Binary Objects|http://download.oracle.com/otn_hosted_doc/coherence/330/com/tangosol/net/cache/BinaryMemoryCalculator.html].
But is there any way to make Binary calculator work with near cache with out modifying code?
BTW, Binary calculator working fine when configured on server side with distributed cache, this is implemented for reporting purposes
          <distributed-scheme>
     <scheme-name>dist-default</scheme-name>
     <backing-map-scheme>
          <local-scheme>
               <unit-calculator>BINARY</unit-calculator>
               <unit-factor>1024</unit-factor>
     </local-scheme>
     </backing-map-scheme>
     <autostart>true</autostart>
          </distributed-scheme>
Kiran

Hi Kiran,
The "front cache" of a near cache stores data in object form. Therefore you can not use BINARY unit-calculator. You need to use "FIXED" type and figure the unit size by dividing 500M/object size in byte.
-Luk

Similar Messages

  • Java Memory Calculation

    Dear all,
    I have class
    Student{
    private int id;
    And my program, init array 10000000 student object.
    size = 10000000;
    Student[] sts = new Student[size];
    for(int i = 0; i< size; i++){
    sts[i] = new Student();
    Learning from
    http://www.javamex.com/tutorials/memory/object_memory_usage.shtml
    and
    http://www.javamex.com/tutorials/memory/array_memory_usage.shtml
    I calculation the memory usage for my programe is
    - 8: house keeping
    - 4 leng
    - size * 4 (object reference)
    - Each Student object size take (8 byte house keeping + 4 byte for id) = 12, padding 4 => 16 byte
    So the total memory is 8 + 4 + 4*size + 16*size = 20*size + 12 ~ 190M
    But the momory usage for my program is 277MB. That is the large difference.
    Could you give me some advice?
    Thank a lot for support.

    Helo..
    Using Windows Task manager is not the proper way to measure a Java programs Memory usage.
    Reason:When you run a java program ,it also requires the underlying JRE to run ,so the memory used for a java process in this case would be the memory for the Java programs Objects and also for the entire JRE.
    The Best way to measure your application's performance is use either of the two free tools:
    1.JConsole-its comes along with JDK. JDK_HOME/bin/jconsole
    2.Any Profiler Programs:A profiler for Java is a program which allows you to trace a running java program and see the memory and CPU consumption for the Java application.Netbeans comes with its own profiler.you can chk this out.
    The other option is to measure free memory before and after execution of the program using System Util Class.
    Hope this clarifies your qn.
    Thanks.

  • Total memory calculation

    Search over internet and get one calculation on memory request:
    Total Memory =
    Dataserver Executable Size (in bytes) +
    Static Overhead of 1 Mb +
    User Connections x 40,960 bytes +
    Open Databases x 644 bytes +
    Locks x 32 bytes +
    Devices x 45,056 bytes
    Procedure Cache +
    Data Cache
    don't understand this in detail.
    Dataserver Executable Size (in bytes) +   ----how to get this ???
    Static Overhead of 1 Mb +                   ---how to calc this???
    User Connections x 40,960 bytes +     ---can get this from server param: number of user connections
    Open Databases x 644 bytes +           ---can get this from server param: number of worker processes
    Locks x 32 bytes +                            -----can get this from server param: number of locks???
    Devices x 45,056 bytes +                   ----number of devices???
    Procedure Cache +                            ---20% of data cache???
    Data Cache                                       --- decided by app???

    Hi Kent,
    > Dataserver Executable Size (in bytes) +   ----how to get this ???
    > Static Overhead of 1 Mb +                   ---how to calc this???
    Why do you need the exact size of the dataserver executable. This size will change which every new version of the binaries that you would use.
    The best way to check the size of the memory requirements for ASE is to set up the 'max memory' variable. This setting will set the upper limit for the memory allocation in ASE.
    The easiest way to check what is the current memory usage by running
    sp_configure 'total logical memory'
    More details are here:
    How much memory to configure
    All the other parameters are also set by sp_configure.
    When you add some memory to some functionality, the remaining memory from (max memory - total logical memory) will decrease.
    > Locks x 32 bytes +                            -----can get this from server param: number of locks???
    correct
    >Devices x 45,056 bytes +                   ----number of devices???
    correct
    > Procedure Cache +                            ---20% of data cache???
    incorrect
    The procedure cache is set up by 2k page size
    sp_configure 'procedure cache size'
    > Data Cache                                       --- decided by app???
    This is the sum of all your data cache:
    sp_cacheconfig will give you a summary
    HTH,
    Adam

  • Memory calculation for TN3270 Server

    We are planning to make TN3270 server on CIP.
    Is there any calculation formula to decide memory size for CIP?

    The following URL has formulas for calculating CIP memory utilisation -
    http://www.cisco.com/warp/customer/650/60.html')">http://www.cisco.com/warp/customer/650/60.html

  • Incorrect memory calculation

    when i empty my 1gb memory stick the calculated free space is 129 mb instead of the 1gb. openig the memory stick there is no file in it.
    the same with my macintosh HD. deleting files,the calculated free space does not increase.same size appears beyond the HD icon.
    what can i do that free space is calculated corectly?
    MacBook Pro   Mac OS X (10.4.9)  

    sure i did !
    it's strange, i've got the same problem with another stick. the stick is empty. so is the trash. but the mac says there is only 325mb free.
    by the way: thanks for answering that fast!

  • How to increase Intel HD Graphics (core i3) memory to or near it's maximum value ??

    Dear All
    I got Lenovo G560, Core i3 2.13 ghz, 3G of Ram, with Built in Intel HD Graphic card which minimum graphic memory is 32, the Maximum G.Memory is 1275, BUT the main Proplem is that the actual memory in use is Only 78 - 82 --> so I can't play any of the 512 new games like Need for Speed the RUN or Even NFS : Shift in a medium sitting (it hardly works or crashes in case of low sitting) also can't play Batman Arkham city 2011, it plays Batman arkham asylum within low sitting
    So are there anyway to raise the actual memory in use to just reach 512mb or closer to gain full advantage of my laptop graghic card ?? hope anyone got a Solution for me. !
    by the way working under win 7 home premium 32bit, running latest up to date direct X, and latest driver sofware for the intel HD Graphic display adaptor  .. Ready to increase the ram to be 4 G if that will SURE raise the actual VRAM ..

    first of all, g serie lenovos are not designed for games.
    if you have switchable graphic support ( i don't think g serie does ) try to activate it. otherwise, you have only one option that to increase the ram so shared graphic card can use more ram.

  • Please help :: JVM Memory Calculation

    Hi Guys,
    I've developed a struts based web application. I've got the java.lang.OutOfMemoryError when I tried to retrieve 2000 records in the login page itself. Ofcourse even in my listing of the modules.. i am getting the same...error
    still i have confused with JVM size.. how much to be increased...? presently i have JVM size 32MB with jdk1.5, tomcat 5.5 , linux os..with 1GB RAM
    please suggest..,

    Well firstly i feel Holding 2000 records at a time is ceratinly foolish as sooner or later it would eat up all your JVM heap...
    A better solution in order to maintain this is to use data paging....
    first....
    which you might divde into pages....
    Say for example....
    select count(*) from table_name where <condition>gives you total number of records present.
    Say if you have divded the total records into 100 per Virtual Page
    at a strench fetch first 100 records using properties like rownum(oracle),LIMIT clause in mysql and etc.
    Hold the present page pointers in a bean Scoped session and then fetch the other page accordingly.this saves a lot of memory thought their is a lot of overhead involved.
    the other would be usage of other caching techniques.
    May be the below article might help you in this regard
    http://java.about.com/library/weekly/uc_querycache1.htm
    And if you are still struck to increasing increasing JVM Size you might have to configure it in App server batch server runtime parameters
    check out below article of how configure few app servers to increase JVM Heap
    http://www.chemaxon.com/jchem/doc/admin/tomcat.html
    http://www.redhat.com/docs/manuals/jboss/jboss-eap-4.2/doc/Server_Configuration_Guide/ch02s02s02.html
    http://e-docs.bea.com/wls/docs81/perform/JVMTuning.html
    http://www.ibm.com/developerworks/websphere/library/techarticles/0706_sun/0706_sun.html
    and checkout the below article to findout different technique followed to solve memory leak problems.
    http://support.bea.com/application_content/product_portlets/support_patterns/wls/InvestigatingOutOfMemoryMemoryLeakProblemsPattern.html
    Hope this might help :)
    REGARDS,
    RaHuL

  • Satellite 1900 303 Memory Upgrade

    Hi
    I realise there has been a recent posting on this forum. However I installed 512MB in the user memory expansion slot and realise that the "on-board" 256MB (in my case) is under the keyboard and can be replaced albeit carefully.
    What is the other slot in the memory expansion area.. it looks like a small slot.. like a 133 PIN or something.
    Anyone any ideas ?
    I must say the 512MB has made a notable difference, best 30 I have spent in a while.
    cheers

    Hi
    You are right. On this notebook model only 1 slot is user upgradeable. This slot is placed under the Expansion memory module cover (near the cooling fan). Original memory module is PC2100 512MB (PA3164U-1M51). It is 200 pin memory module and it is pretty small, not so big as on desktops.
    I can tell you only one thing: be sure you have compatible one and everything will be OK.
    Bye

  • Problem using Binary wrappers in a Replicated cache

    I'd like to store my keys and values as Binary objects in a replicated cache so I can monitor their size using a BINARY unit-calculator. However, when I attempt to put a key and value as com.tangosol.util.Binary, I get the enclosed IOException.
    I have a very simple sample to reproduce the exception, but I don't see a way to attach it here.
    2008-07-07 09:21:35.061 Oracle Coherence GE 3.3.1/389 <Error> (thread=ReplicatedCache, member=1): Failed to deserialize a key for cache MyMap
    2008-07-07 09:21:35.061 Oracle Coherence GE 3.3.1/389 <Error> (thread=ReplicatedCache, member=1): An exception (java.io.IOException) occurred reading Message LeaseUpdate Type=9 for Service=ReplicatedCache{Name=ReplicatedCache, State=(SERVICE_STARTED), Id=2, Version=3.0, OldestMemberId=1}
    2008-07-07 09:21:35.061 Oracle Coherence GE 3.3.1/389 <Error> (thread=ReplicatedCache, member=1): Terminating ReplicatedCache due to unhandled exception: java.io.IOException
    2008-07-07 09:21:35.061 Oracle Coherence GE 3.3.1/389 <Error> (thread=ReplicatedCache, member=1):
    java.io.IOException: unsupported type / corrupted stream
         at com.tangosol.util.ExternalizableHelper.readObject(ExternalizableHelper.java:2162)
         at com.tangosol.coherence.component.net.Message.readObject(Message.CDB:3)
         at com.tangosol.coherence.component.net.message.LeaseMessage.read(LeaseMessage.CDB:11)
         at com.tangosol.coherence.component.net.message.leaseMessage.ResourceMessage.read(ResourceMessage.CDB:5)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.onNotify(Service.CDB:110)
         at com.tangosol.coherence.component.util.daemon.queueProcessor.service.ReplicatedCache.onNotify(ReplicatedCache.CDB:3)
         at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:35)
         at java.lang.Thread.run(Thread.java:619)
    2008-07-07 09:21:35.061 Oracle Coherence GE 3.3.1/389 <D5> (thread=ReplicatedCache, member=1): Service ReplicatedCache left the cluster

    Hi John,
    Currently the Replicated cache service uses Binary only for internal value representation and does not allow storing arbitrary Binary objects in replicated caches. You should have no problems using partitioned (Distributed) cache service with this approach.
    Regards,
    Gene

  • Oracle use full physical memory

    hi,
    I have Oracle 10g on RHEL5, and I examine server with free -m command.
    [root@prod ~]# free -m
    total used free shared buffers cached
    Mem: 3619 3599 19 0 242 2548
    -/+ buffers/cache: 809 2809
    Swap: 6142 132 6009
    from this report i see that free memory 4gb, but free 19mb.
    then i run "top -b -d 4 -n 1 -u oracle" this command
    top - 12:25:09 up 103 days, 1:38, 3 users, load average: 0.07, 0.04, 0.00
    Tasks: 280 total, 1 running, 279 sleeping, 0 stopped, 0 zombie
    Cpu(s): 0.1%us, 0.1%sy, 0.0%ni, 99.6%id, 0.2%wa, 0.0%hi, 0.0%si, 0.0%st
    Mem: 3705856k total, 3689336k used, 16520k free, 250644k buffers
    Swap: 6289436k total, 135288k used, 6154148k free, 2609836k cached
    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    28330 oracle 15 0 1687m 507m 502m S 0.0 14.0 2:47.47 oracle
    This process is SMON
    Why SMON proccess use 14% memory? can anyone advice in this situation?
    what can I do?

    Please use the code tag with square brackets to format output/code nicely e.g.
    top - 11:56:58 up 35 days, 18:51,  4 users,  load average: 1.00, 1.03, 0.80
    Tasks: 218 total,   2 running, 216 sleeping,   0 stopped,   0 zombie
    Cpu(s):  3.6% us,  1.0% sy,  0.0% ni, 87.1% id,  8.2% wa,  0.0% hi,  0.2% si
    Mem:   4041380k total,  3981164k used,    60216k free,    21124k buffers
    Swap:  8385880k total,   439088k used,  7946792k free,  3193296k cached
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    8886 oracle    25   0 1931m 721m 707m R 98.8 18.3  17:21.79 oracle
        1 root      16   0  4772  436  404 S  0.0  0.0   2:36.11 initWhat is sga_max_size and sga_target size set to?
    Above are few lines of top from my DEV db box, which has 4GB memory.
    I have two db on that box SGA target set to 1GB each and SGA max 1.75GB, so max db usage should be 3.5GB.
    Yet it shows memory usage is nearly 100%, that is fine, because Linux uses free memory for caching.
    Long are swap is heavily not being used, and memory is 100% that is fine. Just because OS is showing 100% does not not mean DB has taken all of that memory.
    Hope I did not confuse you further.
    Regards,
    Edited by: sape007 on Jul 14, 2010 1:08 PM
    Changed from 1.5 to 1.75GB

  • Memory full, close applications and try again...

    hey guys im new here.
    it seems my n95 no longer wants to sent txt messages rather it reports the error message in the title.
    here is what ive got so far:
    - memory reports as 108MB free on internal memory.
    - inbox is virtually empty. sent items is empty.
    - outbox is empty. reports is clear also.
    - there are ZERO applications running verified by pressing and holding the menu key. music and photos are all stored on a memory card with nearly 2GB free.
    - ive updated to the latest V20 firmware.
    any ideas what to do next? is it recoverable?
    Regards
    Martin

    Hi actionman
    Is this on O2?
    Happy to have helped forum in a small way with a Support Ratio = 37.0

  • [Solved] Date command not working, maxing out memory and cpu.

    So I've encountered and incredibly strange problem.
    Today, I was working on a script for my bar panel. I was following z3bra's guide "Meeting at The Bar Really simple stuff, nothing harmful:
    #! /bin/sh
    # Fox - do whatever
    # Gathers various info to be displayed on a panel using BAR
    clock () {
    date '+%a %y/%m/%d %I:%M'
    volume () {
    sed -n 's/^.*\[\([0-9]\+\)%.*$/\1%/p'
    cpuload () {
    mpstat 1 1 | awk '$3 ~ /CPU/ { for(i=1;i<=NF;i++) { if ($i ~ /%idle/) field=i } } $3 ~ /all/ { print 100 - $field }'
    memused() {
    read t f <<< `grep -E 'Mem(Total|Free)' /proc/meminfo |awk '{print $2}'`
    bc <<< "scale=2; 100 - $f / $t * 100" | cut -d. -f1
    network() {
    #The Following assumes you have 3 interfaces: loopback, ethernet, wifi
    read lo int1 int2 <<< `ip link | sed -n 's/^[0-9]: \(.*\):.*$/\1/p'`
    # iwconfig returns an error code if the interface tested has no wireless
    # extensions
    if iwconfig $int1 >/dev/null 2>&1; then
    wifi=$int1
    eth0=$int2
    else
    wifi=$int2
    eth0=$int1
    fi
    # in case you have only one interface, just set it here:
    # int=eth0
    # this line will set the variable $int to $eth0 if it's up, and $wifi
    # otherwise. I assume that if ethernet is UP, then it has priority over
    # wifi. If you have a better idea, please share :)
    ip link show $eth0 | grep 'state UP' >/dev/null && int=$eth0 || int=$wifi
    #This is now the time to see if network is up or not. For that, a simple ping would do the trick:
    # just output the interface name. Could obviously be done in the 'ping'
    # query
    echo -n "$int"
    # Send a single packet, to speed up the test. I use google's DNS 8.8.8.8,
    # but feel free to use any ip address you want. Be sure to put an IP, not a
    # domain name. You'll bypass the DNS resolution that can take some precious
    # miliseconds ;)
    ping -c 1 8.8.8.8 >/dev/null 2>&1 && echo "connected" || echo "disconnected"
    groups() {
    cur=`xprop -root _NET_CURRENT_DESKTOP | awk '{print $3+1}'`
    tot=`xprop -root _NET_NUMBER_OF_DESKTOPS | awk '{print $3}'`
    # Desktop numbers start at 0. if you want desktop 2 to be in second place,
    # start counting from 1 instead of 0. But wou'll lose a group
    for w in `seq 1 $((cur - 1))`; do line="${line}="; done
    # enough =, let's print the current desktop
    line="${line}|"
    # En then the other groups
    for w in `seq $((cur + 2)) $tot`; do line="${line}="; done
    # don't forget to print that line!
    if (($cur < "10"))
    then echo $line=
    else echo $line
    fi
    nowplaying() {
    cur=`mpc current`
    test -n "$cur" && echo $cur || echo "- stopped -"
    # This loop will fill a buffer with our infos, and output it to stdout.
    while :; do
    buf=""
    buf="${buf} [$(groups)] -- "
    buf="${buf} CLK: $(clock) -"
    buf="${buf} NET: $(network) -"
    buf="${buf} CPU: $(cpuload)%% -"
    buf="${buf} RAM: $(memused)%% -"
    buf="${buf} VOL: $(volume)%%"
    buf="${buf} MPD: $(nowplaying)"
    echo $buf
    # use `nowplaying scroll` to get a scrolling output!
    sleep 1 # The HUD will be updated every second
    done
    Once I finished it up, I ran it, and nothing happened. So I took a break, and then came back to troubleshoot it. I ran
    bash -x panel.sh
    and didn't see anything weird so I started to just run each command and make sure my syntax was alright. However, right away when I ran date, no output was generated and within seconds my computer came to a crawl, so I rebooted manually.
    Now, whenever I simply run (without any parameters)
    date
    the exact same thing happens and within seconds htop reports 100% memory usage and nearly 100% CPU usage on all four cores. Luckily, if I'm fast enough, ctrl-c still ends the operation of date.
    I've tried reinstalling coreutils,but that doesn't seem to fix the problem and I can't completely remove it first since a lot of things depend on it.. I have no clue how to even start fixing this. Anyone have an idea?
    Realized where I went stupid, in my ~/Scripts folder, I made a script named date without remember that I had recently added that folder to my PATH. So I created a recursive loop that within seconds would crash my computer... oops.
    Last edited by FoxzTrot (2015-02-08 04:00:24)

    I have found the solution! I post how I managed in case someone else has the same issue.
    You have to go to "Settings" -> "Settings Editor".
    There, there is a "display" entry.
    When you open the tree, you can see both of your displays (in my case, LVDS1 and VGA1).
    Under VGA1 (the "extra" monitor), there is a "Position" entry. There, you need to set the "X" variable to the last pixel of the other display resolution.
    E.g.: if you principal display is a "1366x768", then the "X" value will be 1366.
    You can also play on the "Y" if your screens are not horizontally aligned, but 0 should be fine.
    I hope this helps :-)

  • Cannot install calculator widget. Says it is, but I can't find it. Please help.

    Hello,
    I have tried repeatedly to install Calculator Widget on my laptop, an HP-17. with Firefox. Need this extension for an online business. I am not very adept at computers, and do not understand the information suggested. Can you help, please?

    Big1guy,
    It sounds like the calculator widget is installed on your computer - which is good news!
    The screenshots and information on the addon's page are a little out of date, but you should see a calculator button near the top-right of your Firefox window. I've attached a screenshot of how it looks for me.
    If you're not seeing that calculator icon, the first thing to do would be to check that the widget is enabled. Here's how:
    # Open the Addons Manager - > Extensions.
    # Find the FBA Calculator Widget in the list. Make sure that it isn't greyed out and doesn't have the word ''(disabled)'' in the title. If it does, click the ''Enable'' button.
    # The calculator icon should appear near the top-right of the screen.
    If the widget is enabled but you still can't see the icon, the icon might be hidden. Here's how to unhide it:
    # Click the [[Image:New Fx Menu]] button at the top-right of the screen and then click ''Customise''
    # Under ''Additional Tools and Features'', you should see the FBA Calculator icon
    # Drag the FBA calculator icon onto the row of icons at the top-right of your screen, or into your Firefox menu on the right-hand side of the screen
    # Click ''Exit customise''
    I hope these steps solve the problem. Let us know how you get on!

  • Does initialization of a variable to 'null' take up memory?

    Hi,
    Does initialization of a variable to 'null' take up memory?
    For ex:
    String str = null;
    Then, will the str take up memory?
    Thanks & Regards,
    Jags.

    I suppose that you are referring to local variables, not instance variables.
    String str;It takes only a slot (4 bytes) in stack. If the variable is unused, some compilers will not reserve the 4 bytes. For speed and alignment reasons it is not forbidden to occupy 8 bytes in the stack for the slot. (For instance, 64-bit processors, and some 32-bit processors, usually require that these variables start in memory addresses that are multiples of 8).
    String str = null;It takes a slot (4 bytes) in stack, and some opcodes in program memory.
    If the variable is not used after, the compiler is free to remove the assignment and not reserving the 4 bytes.
    Memory calculations are more difficult than you can think, because JIT compilers are free to use a lot of memory in special structures and restructure your data. So a seemingly innocent String str = null may not occupy memory, or use a lot of it.

  • Why does system exec cause a memory leak to occur?

    Sorry if this has been posted before, but I can't quite figure out why this VI is causing a gigantic memory leak (losing nearly 500K of memory a second). It's a simple system exec call, and I even trivialized everything in order to try and discover the problem.
    Does anyone see a huge problem here? I've tried calling up taskkill afterward as well, though that seemed to make little difference.
    If you don't trust my trivial program (and you probably shouldn't), I've also included the source files for the program - it's a one-line C++ program that returns immediately.
    Any insight is greatly appreciated.
    Thanks!
    Attachments:
    Dilution.vi.zip ‏11 KB

    Try putting a wait - even a 0 second wait - in your loop and see if it makes a difference.  Without a wait, LabVIEW will try to run that loop as fast as possible, possibly so fast that it never yields time to free resources.

Maybe you are looking for