Why are Objects that big in memory?

Hello!
I have written an application that does calender-stuff and for every day I use a day-object with the folloing member-variables:
  public short state;
  public char fSymbol;
  public byte signSymbol;
  public byte workMod;
  public boolean tipAvail;
  public boolean remindAvail;
  public boolean hourTableAvail;
  public boolean toDoAvail;
  public boolean isEditable;
  public int julianDay;
  I theory such an object should need only 15byte + 2 byte Hotspot "per Object" overhead.
In reality one Object needs 67bytes with an interpreted 1.1-jvm and 66bytes with hotwpot-client-1.4!
Where does all the memory go? I know that the jvm does some aligning, but what does it do here?
Does it put each variable onto the next machine-word-lenght?
This does not really bother me on desktop (except MSJVM which is god damn slow) but on J2ME powered mobiles this is really ugly!
Is there any other way than to put everything in ints and mascerade it?
Thanks in advance, lg Clemens
PS: I am using a P4 under Linux-2.6 so machine-word-lenght is 4 byte.

Well, thanks a lot for your thoughts.
1.) No - Unsafe is only available in J2SE-1.4 and not exposed as a public API. I wont use such dangerous stuff...
2.) Well, to be honest I only know that the 1.1-jvm netscape was powered allocated 67byte for each object (the Linux-version withought a JIT).
But Hotspot nearly needs the same amout of memory for the same amount of objects.
Well, happy mascerading and bit-shifting :-(
lg Clemens

Similar Messages

  • [Q] Can Vision track more than one object in a same area - objects that might cross?

    Hi,
    Sorry for that long title, but that's my question.
    Can Vision track more than one object in a same area - objects that might cross?
    Because I'm able to do it, extracting XY, but it looks like "IMAQ Count Objects" doesn't track object frame after but frame, but extract the XY coordinates always in the same way, like example starting from top and everytime he sees an object, he extracts the XY, but if the objects cross (then he will extract XY without caring which objects was the previous one but just based on "scan from top to bottom").
    This is why I opened this topic in the non Vision forum part : http://forums.ni.com/t5/LabVIEW/Sort-XY-by-closest/td-p/2440428
    Thank you,
    Sébastien
    Solved!
    Go to Solution.

    Hi,
    In fact, IMAQ count object order the object regarding their top most and left most pixel, but not regarding their gravity center point.
    Axis origin of an image is situated on the left top corner.
    You need to refer to other caracteristics such as shape or color to identify your objects.
    Regards

  • Why are albums that have various artists appearing as separate albums for each track?

    why are albums that have various artists appearing as separate albums for each track?

    Check the tags via the info panel on each system.
    You may see that one version has settings for 'Disk x of y' disks.
    There are other fields that should be compared too, like 'grouping'. You also need to be certain the playlist (or the Library) are sorted by the same criteria e.g. by 'album' is different to 'album by artist' etc. That can cause unexpected differences in the way it displays.
    I suspect match has given you iTunes copies of the files with Apple's own metadata whilst your originals are from CD with your custom tags.

  • Why are events that have passed being erased in the calendar

    WWhy are events that have passed being erased in the calendar. I like to keep a record of what I have done on any given day, and the calendar keeps erasing things like doctor appointments, etc.

    Setting
    Mail, contacts and calendars
    scroll to the calendar part
    'sync events'. You can go back up to 6 months or 'all events'
    Just be aware that those events contribute to the 'other' that uses up your device's memory, so you'll want to balance the data you keep with the space you want to use

  • Why are songs that I purchased through itunes not able to be loaded to icloud?

    I am having a ton of issues getting my library on both my home comuter and my laptop.  I deleted my Icloud and then reloaded it with all the music from my home computer.  My plan is to turn on Itunes match on my laptop and download all my songs.  The problem I am having is that some of my songs are not eligable to upload to icloud??? I am not sure what that even means.  Some of these song are some that i have purchased in just the last few months from itunes and now they are not eligable to upload to icloud.  What am I supposed to do to get my music on both computers???

    id4craig wrote:
    I deleted my Icloud and then reloaded it with all the music from my home computer.
    I do not undestand what you mean. iCloud is not the same as iTunes Match. The two services are separate and distinct and one does not require the other.
    If you are trying to copy music files from one computer to another using iTunes Match is not the most effective way to do that. See this Apple KB article for more information: http://support.apple.com/kb/HT4527.
    Once you get the music copied over you can enable iTunes Match. It will scan the library and mirror it with what is in the cloud. As to the songs that are "ineligable" tell us what the exact status is for the tracks. Switch to Song view and pull down View > View Options and select iCloud Status, then close the small window. Post the status for the songs back here.

  • Why are object alloc delays occuring outside of GC?

    Hi
    I'm currently tuning an application which has a low latency transaction requirement (sub 5ms ideally), hence we're using JRockit RT with an 8ms deterministic strategy (we're not achieving 8ms GC pause, but some time ago we experimented and found this was a good setting for us).
    I'm currently focused on addressing latency spikes which we're hoping to bring down from many hundreds of ms to the order of 10-20ms. Many of the spikes are occurring during GC activity as one would expect, but I'm currently looking at some spikes outside of GC which I'm struggling to understand the cause of. What I seem to be seeing is object alloc delays which are occuring and then being resolved, but outside of any GC activity.
    For example, see the following snippet from the log. Cmd line params include:
    -Xverbose:memory,memdbg=debug,gcpause=debug,compaction,gcreport,refobj
    -Xgcprio:deterministic
    -Xpausetarget=8ms
    Version=
    java version "1.6.0_05"
    Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
    BEA JRockit(R) (build R27.6.0-50_o-100423-1.6.0_05-20080626-2104-linux-x86_64, compiled mode)
    [memory ][Wed May 26 12:31:38 2010][23134] Pause 'OC:Cleanup' took 0.179 ms (ended at 1545.738649 s).
    [memory ][Wed May 26 12:31:38 2010][23134] 1539.900-1545.738: GC 13279297K->11726889K (14680064K), sum of pauses 386.637 ms
    [memdbg ][Wed May 26 12:31:38 2010][23134] Page faults before GC: 1, page faults after GC: 1, pages in heap: 3670016
    [finaliz][Wed May 26 12:31:38 2010][23134] (OC) Pending finalizers 0->0
    [memdbg ][Wed May 26 12:31:38 2010][23134] Restarting of javathreads took 0.257 ms
    *[gcpause][Wed May 26 12:31:38 2010][23134] Thread "pool-1-thread-1" id=217 idx=0x36c tid=25388 was in object alloc 75.397 ms from 1546.387 s*
    [memdbg ][Wed May 26 12:34:04 2010][23134] GC reason: Other, cause: Memleak Request Data
    [memdbg ][Wed May 26 12:34:04 2010][23134] Stopping of javathreads took 0.817 ms
    [memdbg ][Wed May 26 12:34:04 2010][23134] old collection 38 started
    [memdbg ][Wed May 26 12:34:04 2010][23134] Alloc Queue size before GC: 0, tlas: 0, oldest: 0
    [memdbg ][Wed May 26 12:34:04 2010][23134] Compacting 1 heap parts at index 44 (type internal) (exceptional false)
    The above log segment shows the tail of a GC which has just completed, then an object alloc delay for 75ms for thread "pool-1-thread-1", and then a subsequent GC kicks in much later which I believe is unrelated. I have a JRA trace from the test which shows that the object alloc latency event occurred almost a full second after the completion of the GC activity - something you can't see from the above trace which has second resolution in the timestamp.
    What I'm unsure of is exactly how the object alloc delay can occur and then be rectified by the JVM outside of a GC. I understood the main cause of an object alloc latency event was that memory wasn't available (i.e. TLA does not have enough free space and a new TLA cannot be allocated) and that a GC would be required to free up memory to allow either a new TLA to be allocated or free up enough space in an existing one. We see an "object alloc" latency delay which follows the above pattern after every GC so I'm guessing it must somehow be related to the GC which has just finished, but I can't figure out how. My hope is to eliminate this kind of latency delay completely or at least down to single-figure ms delays.
    Perhaps the deterministic GC means some memory reclaim is happening in parallel outside of the reported GC activity, but I'd be very surprised if this was the reason as surely the collector would be reporting it's activity more fully. It's been a while since I've looked this closedly at GC so I may have forgotten something.
    Any help you can provide in working out how to address such latency spikes would be very helpful!
    Thanks
    Stuart

    I think the extra time is due to the compaction of the heap (which occurs after a garbage collection).
    Note also that a very low pausetarget can stress the garbage collector to less appreciated behavior, when the application and the hardware or not appropriate. If you look at the application about 30% live data or less at collection time is something your application should strive at. Running with more live data might break the deterministic behavior (depending on the hardware of course).
    You can tune compaction with the determistic collector as follows,
    MEASUREMENT_ARGS="-Xverbose:gc,gcpause,memdbg"
    export MEASUREMENT_ARGS
    USER_MEM_ARGS="${MEASUREMENT_ARGS} -Xms512m -Xmx1000m -Xns256m -Xgcprio:deterministic -XpauseTarget=30ms -XXgcThreads:2 -XXtlaSize:min=2k,preferred=16k -XXcompactSetLimitPerObject:500 -XXinitialPointerVectorSize:40 -XXmaxPooledPointerVectorSize:8000 -XXpointerMatrixLinearSeekDistance:5"
    export USER_MEM_ARGS
    The last four options are used to tune compaction for the deterministic collector. In optimizing compaction try to reduce object references, because when a object is moved during compaction its references must be updated. So moving an object with a lot of references is more costly than moving an object with a few references.
    Refer to http://otndnld.oracle.co.jp/document/products/jrockit/jrdocs/pdf/refman.pdf for more information.

  • Why are objects becoming distorted when zoomed in?

    Lets say for example that I create a target shape at a relatively large size. I will then shrink it down to a more appropriate size and proceed to zoom in on the object. When I zoom in, the target becomes completely distorted. This is a problem that I came across recently as I have just upgraded from cs4 to cs5.1. Since Illustrator is vector based, objects should be crisp and look the same whether they are scaled to the size of the full artboard or down to just 1% of it, correct?
    I have posted a screen shot of the issue that I am running into below. The larger shape on the left is normal, and the shape on the right is that same shape just scaled down. Note: this shape does not have strokes, it is a solid fill. Thanks for any help in advance!

    This is what I had originally thought was the issue, so I created a new doument making sure to uncheck the box for the pixel grid. I then dragged the above shape into the new document and the problem persisted. However, when I recreated a similar shape in the new document, there was no distortion (as expected). It seems that for some reason an object created in a document with the pixel grid option turned on keeps those settings when carried into the new document.
    Is there a way around this or am I going to have to recreate everything in the new document?
    Thanks for tee response, btw!

  • Why are objects unselected when unhiding in InDesign?

    In the past, if I hid multiple objects and then chose "show all", the objects would all be selected or active selections. Now the objects unhide but are not selected. Is this a preference? Am I mistaken that maybe this is only an Illustrator feature?

    to get the best quality files in InDesign- import them, dont drag them over. use File>Place.
    make sure send image data is set to all when printing. (print>settings>graphics and then under images set "send data" to "all")
    also: place your TFF in the frame. you can always fitting > content to frame.
    -janelle

  • Why are games so big on facebook?

    when i play games on facebook (when iam using firefox) all the games are to big ,i cant most of them for this reason.

    Reset the page zoom on pages that cause problems: <b>View > Zoom > Reset</b> (Ctrl+0 (zero); Cmd+0 on Mac)
    *http://kb.mozillazine.org/Zoom_text_of_web_pages

  • Why are contacts that I create on my MacBook not syncing in iCloud  on iphone 4S?

    Contacts that I create in "Contacts" on my MacBook Pro Retina are not syncing up through iCloud on my iPhone 4s.  My MacBook is running OSX 10.8 and iPhone is running  5.1.1
    Before you say the obvious.......YES, I checked the new contact to be grouped in iCloud not "On my Mac".  This is very frustrating.
    Thanks!

    Have you followed Apple's troubleshooting tips?
    http://support.apple.com/kb/TS3998

  • Why are websites that I've visited displaying along the top of my tab

    Hi,
    Since yesterday, when we click on the address bar to type in it on my mothers ipad2, some of the websites that she has previously visited are showing up in a line along the top of the tab.
    Can anyone tell us how to get rid of this - its not a major problem but it is a niggle.
    P.s - we are not technically minded!!
    Thank you for any help given,
    Chimpy2

    Hi,
    Just discovered the problem! Some bookmarks had been placed in Bookmarks Bar so by moving them it cleared the tab.
    Easy when you discover what the problem is!!
    Thankyou

  • Why are objects in tables removed when opening a document (created in pages 2009) in the new pages?

    I have a problem: Documents I created in Pages 2009, when opened in the new Pages I get "objects in tables were removed".
    This makes all my documents useless !
    Is there any way to get the objects (images and tables mostly) to load into the tables across all my documents ?

    No, there isn't. Use Pages 09 with your old documents and Pages 5.0 for creating new ones. Do you really need Pages 5.0 is the question you need to answer. If not, don't.

  • Why are photos that are placed on the page not showing up in links panel?

    seems really random, I have 2 files that have several photos on them, but one photo on each is not showing in the links panel

    not sure, just checking on errors from other co-workers, but I tried copying and
    pasting from Quark and got the same result, so that is probably what they did.
    thanks

  • Why are tabs that say redirecting open and have nothing to do with the site i am working with and how do i stop this

    Easy example just clicking an email It will open a tab to play a game or to install flp media player I also work with ebay I go to click on an item then a new tab opens saying redirecting and goes to an add. website I tried the ask before installing for the cookies thing but even just getting to this page a window opened for allowing a cookie i assumed it was for firefox so i allowed it now a window opened for a game {Forge of Empires} this is getting to be a pain I'm thinking of going back to IE

    Hello,
    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from http://www.mozilla.org and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (click Exit from the Firefox or File menu).
    #Delete the Firefox installation folder, which is located in one of these locations, by default:
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    Please report back to see if this helped you!
    Thank you.

  • Why are programs that ran on v3.6.18 not working on v4 & 5

    I had A greeting card program & a password saver, neither work on Firfox v5 They worked on V3.6.18, can I go back to V3.6.18

    I had A greeting card program & a password saver, neither work on Firfox v5 They worked on V3.6.18, can I go back to V3.6.18

Maybe you are looking for

  • Why can't I use some form of parental control like IE to make it safe for my Kids?

    I am just about to remove Firefox from my pc because I cant figure out how to protect my kids from the crap that is on the web!! I don't want them accidentally getting to an adult site.

  • Package missing in KM installation

    I have installed EP6.0 on WAS6.4 and installed KM on it. I have also applied SP12 patch for both EP AND KM. The problem is when i visit content management in portal it does not shoe any images (like folder etc.). I tried to investigate the problem an

  • Is it possible to have same patch in different sets?

    My MainStage is going to have it's first gig on 29th. I'm now organizing the patches so that changing them would be as fluent as possible. The most practiful way that I've come up with is to have a set per a group of songs. Now, I have two patches th

  • MEREQ001-Valuation price change

    Hi All, I need to do an enhancement using MEREQ001. while executing me51n, the system fetches valuation price automatically for the material but in my case i need to fetch price from the latest PO. for this purpose which function exit do i use and ho

  • Panel box

    hi im using a panel box layout in my page. i have background color for my page. i dont want the border of the panel box to be visible so tht the screen appears more perfect. i tried giving the inline styles.but i didnt succeed. and i didnt find any s