Why is sizeof operator not in java ?

Hello friends..
I am having one doubt.
Why is sizeof operator not in java ?
Can anybody please help ?
Thanks and Regards
Rohit.

An object often refers to other objects. These object may or may not have multiple references (so counting them more than once is not accurate) The actual amount of memory used is often greater than you might expect if you are used to C/C++. The system also uses memory in sometime unpredicable ways. Many methods create transient objects adding to your memory requirement. Shared libraries, the stack, the JVM itself do not appear in the heap size but use memory. Files accessed by the application can be significantly effect the desirable file cache size.
The only real way to determine your application's memory requirement is to actively test the application, anything else is just guess work.

Similar Messages

  • HT5246 Why, if I have not installed Java, is Flashback malware a threat on my mac?

    Why, if I have not installed Java, is Flashback malware a threat on my mac?

    Older variants of Flashback did not rely on Java, and if you upgraded to Lion after becoming infected with a Java variant, you would still be infected even without Java.  (The malware itself does not need Java, only the installer for recent variants does.)

  • Jli.dll: why it's is not a Java question?

    jli.dll came with the downloaded program. Why lock my question?

    probably because this is not a scite forum. certainly I had no idea what is was when I read your post.
    -- and becuase this post doesn't say that the downloaded program is actually the JDK (or is it??) - if you make us guess what you could have actually told us - we are less likely to feel inclined to help you - don't assume we can read your mind.
    however I have done a few moments research and it looks like it might be vaguely java related (but not java compiler related).
    My windows install of java indeed does contain a jli.dll so if your's does not, it might be stuffed, and if the msi is corrupt, that might be why it didn't get installed.
    I would try to download a new copy and reinstall the JDK and see what what happens. If there are problems (basic JDK problems - not skite problems) then post to the [ new to java|http://forums.sun.com/forum.jspa?forumID=54] forum for assistance. for skite problems go ask skite site.

  • Why not Deprecate java.util.Date and java.util.Calendar

    With the introduction of java.time, why did you not flag java.util.Date and java.util.Calendar. These classes have been a bane to every Java developer and should never be used again with the introduction of Java 1.8.

    Adding the @Deprecated annotation would only just provide a warning about an old API and recommendation to the developer(s) to no longer use it. Doing so would not break any existing library out there; in fact quite a number of constructors and methods on the Date class have already been flagged deprecated.
    The new java.time package is far superior to Date/Calendar.

  • Why sun leader do not think about  "Why Java Web Start not be used widely"

    {color:#ff0000}Why sun leader do not think about "Why Java Web Start not be used widely"
    {color}
    Java Web Start was instruduced in jdk1.2, it's about ten years ago,But it's still not widely used--WHY?
    it's not because the design, it's becasue the code--the garbage code-- even the last version not work in many user computers,
    just not work suddendly -- noboday know reason--- if you do not believe, please google internet, many people suffered and suffering from web start!
    It's incredible that a famous big company like sun can not resolve an deployment problen in ten years that some very small company can do good work in much more short time !!!
    That' sun-- always say and design good things, then publish trouble and pain to their users. I really do not know what the sun's engineers are doing in so
    many years! -- why they do not know deployment is so important than others -- if deployment work fine, then the wrong thing can be correct easy !
    Sun, please do an famous big company -- give happy to user rather than pain !!! Please give us -- your users an stable and fast java web start to save us.
    {color:#ff6600}(Note: I use java web start to depoly our application, then receive endless complains, not work, slow and so on. now, we has no way just to give it up--design ourself's deployment-- that's also done by many pained people---just google it){color}
    Here is an desing suggestion:
    Client-end should be simple and stable, should let the server-end do complex thing .(now sun do opposite thing, they make Client-end complex, but server simple) ---it's because that Client-end will take widely effect on user's computer. update a few server is much more easy then update a amount of clients!
    Edited by: Jethro-Soft on Jun 30, 2008 8:49 PM
    Edited by: Jethro-Soft on Jun 30, 2008 8:52 PM

    Please check:
    http://joust.kano.net/weblog/archive/2006/04/06/why-i-will-never-deploy-with-java-web-start-again/
    http://kylecordes.com/2006/04/08/auto-update-no-web-start/

  • Why do iPhones/iPad not support Flash Player/Java and what are my alternatives for browsing sites using these plug-ins?

    Why do iPhones/iPad not support Flash Player/Java and what are my alternatives for browsing sites using these plug-ins?

    There are also iSwifter, Photon, Skyfire, etc., some only support Flash some support Java and Flash.
    Adobe never made a version of Flash for iOS and closed their mobile flash division a couple of years ago. You can get Flash on other personal devices but you will be using a 2 year old version that has not been patched for security vulnerabilities.
    When the original iPhone was released Mr. Jobs said it would never run Java as it was old technology and a security risk. Nothing has changed since.

  • Why do I get an error msg that reads "operation not allowed" whenever I try to Remove Attributes from my timeline?

    On any given project, whenever I select everything in my timeline and try to remove all the attributes, I get an error message that reads "operation not allowed."
    If I select a smaller chuck of files on my timeline and hit remove attributes, it works, but this isn't the case if I select everything in my timeline.
    How do I fix this? Thanks!

    Have you tried trashing your Final Cut Pro preferences? It is usually the first step when FCP begins to act in unexpected ways.
    Download Preference Manager (free) from Digital Rebellion
    http://www.digitalrebellion.com/prefman/
    and use it to trash your preferences - they will be set to default the next time you open FCP.
    If that does not remedy the problem, do you have any still images in your timeline that are not RGB, or are greater than 4000 pixels in the widest dimension?
    Is your source material in an FCP7 edit friendly codec?
    MtD

  • Why can not find Java VM when Install JWSDP 1.6?

    I am using winXP.I have installed J2SE 5.0 by default.I want to install JWSDP 1.6 but when I runned JWSDP 1.6. install script, there is always a message error that it can not find Java VM.
    I have tried in command prompt
    jwsdp-1_6-windows-i586.exe -is:javahome c:\Sun\AppServer
    jwsdp-1_6-windows-i586.exe -is:javahome c:\Sun\AppServer\jdk
    jwsdp-1_6-windows-i586.exe -is:javahome c:\Sun\AppServer\jdk\bin
    but nothing worked. What sould I do?
    Thanks,

    I am using winXP.I have installed J2SE 5.0 by
    default.I want to install JWSDP 1.6 but when I runned
    JWSDP 1.6. install script, there is always a message
    error that it can not find Java VM.
    I have tried in command prompt
    jwsdp-1_6-windows-i586.exe -is:javahome
    c:\Sun\AppServer
    jwsdp-1_6-windows-i586.exe -is:javahome
    c:\Sun\AppServer\jdk
    jwsdp-1_6-windows-i586.exe -is:javahome
    c:\Sun\AppServer\jdk\bin
    but nothing worked. What sould I do?
    Thanks,I really don't quite follow what your problem is But:
    Are you sure it's { the script } is not looking for JAVA_HOME environmental Variable?
    You could try: Control Panel - System - Advanced - Environment Variables
    and see if it has an Entry for "JAVA_HOME"
    if it does ensure it is pointing to the correct directory:
    ie the one that has the directories bin, jre, lib
    in it. for me that is C:\Java\jdk1.5
    for you it's probaly C:\Java1-5-05 or whatever
    If it doesn't add a new entry for it.
    in my case:
    JAVA_HOME C:\Java\jdk1.5
    Normally I just double click on those .exe's and they install fine.........

  • Why C/C++ and NOT Java??*

    Java is considered to be a much better programming language than its predecessors C and C++ then why there is no demand for java programmers.The demand for C/C++ programmers is hardly affected.What is that java cant and C/C++ can??????

    Java is considered to be a much better programming
    language than its predecessors C and C++I doubt that. :-)
    Some jobs are better done with Java, some with C or C++.
    It also depends on the developer and his experience with these tools.
    The comparsion is problematic too.
    While C and C++ are languages, where the runtime matters more or less for discussion, talking about Java nearly always implies talking about Java the platform as well. Java cut down to the language core isn't that much different from C++, and will become even more similiar.
    C++ is typically compiled for a target CPU and strong regarding efficiency.
    Java is typically run for a VM and strong where this is strong, like offering reflection or code verification or platform independence.
    A big difference are the libraries. Java's is very large, in fact it is close to an OS, and because it was made later, of more modern design than the C++ ones.
    there is no demand for java programmers.The demand for
    C/C++ programmers is hardly affected.What is that java
    cant and C/C++ can??????I don't know. Perhaps Java was a bit more popular in the new economy and thus hit harder by the deflation.
    But honestly, I doubt such a bias.
    Regards,
    Marc

  • NOKIA lumia windows 8 phones not supporting JAVA

    Hi Nokia lumia latest windows 8 phones not supporting java. I Think its a big draw back because we cant install any java apps like Mobile banking Apps. Java apps market increasing day by day. Why nokia avoid this feature. is there any solution for this problem.

    no solution unfortunately, however you may be able to try your luck with the WebApps app from the Store, and then search for your particular mobile banking website within that app.
    and no, it is not Nokia that is not implementing support for Java, it is part of the Microsoft Windows Phone 8 operating system. if you wish to leave feedback with them, you can do so over at http://windowsphone.uservoice.com

  • JDBC + MySQL : "Operation Not Allowed After ResultSet Closed"

    I have a very short piece of code. I use one connection to the database. I execute a query, get back a lot of rows, then iterate through the result set and for each row I get some information and then perform an insert into a different table.
    The problem is that the big result set I am iterating through keeps closing sometime during the first iteration. Why? I am using three different statements:
    1) Statement 1 is for the main query I want to iterate through
    2) Statement 2 is for a quick lookup I perform (on a different table) for each item in the iteration.
    3) Statement 3 is for the Insert statement which I perform for each item in the iteration. Again, I insert into a different table and I use "executeUpdate"
    Given the I have three different statements and I am working with three different tables, why does my main result set that I am iterating through keep closing on me?
    Here is the error I am getting:
    java.sql.SQLException: Operation not allowed after ResultSet closed
    at com.mysql.jdbc.ResultSet.checkClosed(ResultSet.java:3603)
    at com.mysql.jdbc.ResultSet.next(ResultSet.java:2468)
    at com.mysql.jdbc.UpdatableResultSet.next(UpdatableResultSet.java:565)
    Thanks for your help.

    I have a very short piece of code. I use one
    connection to the database. I execute a query, get
    back a lot of rows, then iterate through the result
    set and for each row I get some information and then
    perform an insert into a different table.Sounds like a classic case of making Java do what the database was made to do.
    I'd bet you can do this in a single INSERT with a SELECT in the database in one network roundtrip. The "quick lookup" might be a JOIN or a sub-SELECT. When you do a query, bring N rows back to the middle tier, then do an INSERT for each row that you retrieve it means (N+1) network roundtrips if you don't batch your INSERTs. I'd have a SQL expert give your code a look.
    The problem is that the big result set I am iterating
    through keeps closing sometime during the first
    iteration. Why? I am using three different
    statements:
    1) Statement 1 is for the main query I want to
    iterate through
    2) Statement 2 is for a quick lookup I perform (on a
    different table) for each item in the iteration.
    3) Statement 3 is for the Insert statement which I
    perform for each item in the iteration. Again, I
    insert into a different table and I use
    "executeUpdate"
    Given the I have three different statements and I am
    working with three different tables, why does my main
    result set that I am iterating through keep closing
    on me?Maybe your ResultSet or Statement goes out of scope. Do the Statements share a Connection?
    %

  • CVI2010 sizeof-operator returns a wrong size of a struct

    Hi,
    in CVI2010 the sizeof-operator returns a wrong size of a struct, if it contains 4 bytes and other spaces. I suppose the adresses in the struct are also not like a c-programmer thinks. First a minimalistic code-example:
    typedef struct
      char oneByte;
      long fourByte;
    } TestStruct;
    void main( )
        int size;
        TestStruct tmpVar;
        size = sizeof( TestStruct );
        // here is size=8 instead of 5
    Since the last years and the last cvi-versions i had ever compiled
    with the Borland-compiler, that returns the correct size. Because in CVI 2010 the Borland-compiler is
    not included, i'm trying to use the standard build-In compiler. In my opinion the compiler seems to optimize the code in a way, my
    project can't work with.
    Because i'm reading the struct direct out of binary files i'm searching for a, not code based, solution.
    Is it possible to deactivate the relevant optimization?
    Thanks for your help and answer.
    Markus
    Solved!
    Go to Solution.

    The compiler can have different alignments for struct fields: a usual behaviour is to have them aligned on a 4-byte boundary, that is every field starts on a multiple of 4 bytes from the beginning of the struct in memory. This appears to be the behaviour of the compiler you are using at the moment, which returns 8 as the size of the struct having aligned the fields.
    Struct alignment can be modified with an appropriate #pragma preprocessor instruction: adding #pragma pack (1); in your code instructs the compiler to pack structure fields without padding; after this instruction sizeof  will return the 5-bytes dimension you are expecting.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Disc Burner. Why are some files not readable or writeable?

    Hello,
    I am trying to backup my friends computer files on a beige G3 (233 MHz). I am burning about 6 DVDs of AIF music files. Most of the files are about 30 - 40 Megs in size. Often I receive error messages on particular files that read:
    "The operation cannot be completed because some data cannot be read or written.
    (Error code - 36)"
    Followed by the choices: "Stop" or "Continue".
    I have a bad feeling that my startup disk is too small but I am not sure.
    Most of the files work fine. However some of the files cause disc burner to not be able to use them in the disc image before I burn. Why would this be?
    Here are the specifications:
    Computer: beige G3 with two hard drives (one SCSI and one ATA hard drive) and a Pioneer DVR-110D DVD writer which is Apple supported (Apple system profiler indicates Apple supported on this DVD writer). My blank DVD disks are Sony Vermatim DVD-R (1 - 16x speed support). Although I think my beige G3 only writes them at about 2 or 4x.
    I am using OS 10.1.5. My startup disk which has OS 10.1.5 in it is a 4 GIG SCSI disk. Is this big enough for a startup disk (for creating 4.5 GIG DVDs)? My files are on the second hard drive which is a 40 GIG ATA disk.
    I have a bad feeling that my OSX startup drive is too small for disk burning - it is only 4 GIGs in total and OSX Disc burner (Disc copy) is first making a disk image on my startup volume before it burns it. Perhaps that disk image is too large for the startup volume. Is there any way I could ask OSX to put this disk image on the second larger hard drive instead (not the startup drive?).
    Here is my process (I hope I am doing this right - I am new at this):
    1. I first insert a blank DVD-R
    2. A message pops up asking my if I would like to create a blank disc image for this disk (I think this is the typical Disk Copy utility window. I say "yes" and give it a name and choose the "DVD-R or DVD-RAM" option. (I am not sure if there are other important settings to choose here or better settings to use but I guessed the other options that seemed obvious. A blank disk image is created with an icon that looks like a DVD disk.
    3. Then I drag my chosen files to this blank disc image. It takes about 30 minutes to copy over. Thats when I receive the error message that some files couldn't be "read or written". The other files work fine but it would be nice if they all worked.
    Why would some files not be readable or writeable?
    4. Then I choose file/burn in the top menu and the DVD is created. This takes another 20 - 30 minutes. At the very end of the process another message pops up saying:
    "Sorry the operation could not be completed because an unexpected error occured (error code -28)" Followed by an "OK" button.
    However all the files that made it onto the final DVD are fine - its just that its not all of the ones I originally chose in the first step when dragging to create the disk image.
    Am I doing this the right way?
    Why are some files not "readable or writeable" as it indicates in the error message?
    Is my 4 GIG startup disk too small for this? or are the music files possibly corrupt? or could there be some other possible problem?
    Thanks

    To follow up, I have some good news. After following your advice Kappy, it now works very well Thanks! Instead of using the 4 GIG volume for the OS, I am now using an 8 GIG partition on an 80 GIG drive. So now the OS has some room to operate. No disk errors occured on my first DVD
    Now there was one problem. The second DVD burned gave me an error. I am not sure why but I am going to guess that because I had to installed the OS onto an 8 GIG partition maybe the OS needs to be rebooted in between disk burns because although 8 GIGs is certainly greater than the 4 GIGs I gave it last time, it still isn't a lot of space - maybe just enough to do one DVD at a time. Thats only a guess. So I rebooted to see if that clears the system out ready for the next DVD and I am trying to burn the second DVD again. If I remember I will report back. In any case, yes, this seems to be working. I hope this second DVD burns well too.
    Thanks Kappy

  • Why Oracle 8i is not Working with JDK 1.3

    Why Oracle 8i is not Working with JDK 1.3 by using JDBC.

    try this
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:"somedsn","scott","tiger");
    I am using this for Oracle, it is working for me.
    Uma
    Java Developer
    http://www.globalleafs.com

  • Why does for-each not work with Enumeration?

    I'm sure there's some reason for this but I don't know what it would be.
    I am calling an existing method [http://java.sun.com/javase/6/docs/api/java/util/zip/ZipFile.html#entries()] And it returns Enumeration<? extends ZipEntry>
    What I would like to do is
    Enumeration<? extends ZipEntry> entries = myzipfile.entries();
    for(ZipEntry ze : entries)but this won't compile because Enumeration is not an Iterator. Which kinda sucks.
    Obviously (I think) Enumeration can't be retrofit to be an Iterator without problems and the APIs that return Enumeration can't change without problems so it seems the only way that for-each would work with an Enumeration is if for-each was allowed to work with Iterator and Enumeration.
    So my question is, why isn't it? (To be clear I know how to enumerate an Enumeration, I'd just like to know if anybody has a clue why for-each was not designed to support Enumeration)

    Still it does'nt fully answer the why question. Why does the Collections class not implement a static iterable(Enumeration) method that does not impose the overhead of an addiditional ArrayList, as in the following class:
    import java.util.Collections;
    import java.util.Enumeration;
    import java.util.Iterator;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipFile;
    public class EnumerationToIterable {
        public static <T> Iterable<T> iterable(final Enumeration<T> enumeration) {
         return new Iterable<T>() {
             @Override
             public Iterator<T> iterator() {
              return new Iterator<T>() {
                  @Override
                  public boolean hasNext() {
                   return enumeration.hasMoreElements();
                  @Override
                  public T next() {
                   return enumeration.nextElement();
                  @Override
                  public void remove() {
                   throw new UnsupportedOperationException();
        public void iterateOne(ZipFile myzipfile) {
         Enumeration<? extends ZipEntry> entries = myzipfile.entries();
         for (ZipEntry ze : Collections.list(entries)) {
             // process ze
        public void iterateTwo(ZipFile myzipfile) {
         Enumeration<? extends ZipEntry> entries = myzipfile.entries();
         for (ZipEntry ze : iterable(entries)) {
             // process ze
    }Could it be more simple?
    (Thanks for the Dukes)
    Piet

Maybe you are looking for

  • IIf Expression: The first of many questions. Thank you in advance.

    One of the situations I am in need of assistance with is the following "IIf" statement: =IIf([Check36]=Off,10,0)           The expression is located in a field [LateFee]. When, [Check36], is Off, $10.00 is displayed, if On then $0.00 is displayed. I

  • Is there anyone who has a G3 who can read my floppy?

    I wrote a book in the mid-1990s and stored it on what was available at the time:  double density 3.5-inch floppies.  I would like to see if the data are retrievable and have read that G3 powerbooks can read these discs.  Is there anyone out there wit

  • Help in Optimizing code

    Hello experts, I have a function module that runs so slow, I just want to seek some advice to help me have a better performance speed what can I used and alternatives to make my codes faster... any advice can help Heres my <b> code </b> <b>Declaratio

  • CCMS registration error

    I have made new installation of SAP NetWeaver 7.01 ABAP Trial in a Windows Xp machine. After the installation i could not find the CCMS agent listed in transaction rz21 -> Topology -> Agents for Local System ( also there is no data CCMS Monitor Sets

  • How to play all movies on Apple TV

    Hi, I have couple movies on the Apple TV. But Each time, I have press play to next movie. How to do like Photo and Music? They are keep playing. Is this possible? Any trick to play all movies on Apple TV without keep press play to continue to next mo