Will size of .class files differ

Hi All,
I have compiled a pre compiled .java file on other system, in my system. The size of .class file differed.
Will this happen, irrespective of systems with same O/S.
Thanks,
Aravind

Hi,
Yes it can differ. It depends on if you are using the same compiler or not, and if you are building a debug version or not.
/Kaj

Similar Messages

  • Handling .class files insite java process

    Hello folks
    I have a question regarding JVMPI and JVM: I have created a small proff-of-concept program that handles JVMPI_EVENT_CLASS_LOAD_HOOK and JVMPI_EVENT_CLASS_LOAD events. After my class (simple Test.java with System.out.println) has beed loaded (*CLASSLOAD_HOOK event) I remembered pointer and size of .class file in memory of java process. Then, after CLASSLOAD event I filled this memory with zeroes (memset) to see if Test.class will execute normally. And it did worked fine. My question is: does java process need this memory after JVMPI_EVENT_CLASS_LOAD event? Can I safely override .class file data?
    Best Regards
    Boloek

    At some point, the JVM writes the contents of the
    class file into memory that's accessible via coredump.
    Otherwise it couldn't execute the bytecodes. If you
    zero out the memory where the physical .class file was
    loaded, it won't affect the memory where the actual
    class is stored.you are wrong :-) I did some testing and I caught three events:
    - LOADHOOK where I remembered pointer to .class file and size of it
    - _LOAD where I zeroed this memory
    - JVMSHUT_DOWN where I caused SIGSEGV to force coredump.
    I tested two cases: with and without clearing memory and then searched two different core-files for content of *.class file. I only found it in core dumped in a situation when I did not use memset to clear memory. It is because (as I assume) java process after loading .class file makes some optimisations to efficiently execute bytecode so representation of my code exists in memory of proces but in unreadable, undocummented and undecompilable (at least for non jvm developers) format which is characteristic to particular JVM implementation
    Someone who wants your code badly enough is going to
    get it.sure but I try to make him this task as difficult as I can ;)
    Best Regards
    Boloek

  • Why are files in Firefox 33 cache directory different size than saved files on desktop

    In previous versions of Firefox I used the cache directory to extract videos, flash files and hidden images, that were not saved in folder and a HTML Document file on desktop. For Example the opening image of a YouTube Video can not be extracted and saved from Firefox but is stored in the cache directory.
    To find these files without going through them one at a time, I would copy the cache folder on a desktop folder and then use Double Killer to delete the same size files in both the cache and the saved files in the desktop file folder. The files that are left behind in the cache folder are those that did not save to the desktop file and folder. I can then double check to see if I can find the videos, flash or images from the remaining files.
    I have updated to Firefox 30.0.3. The problem now is that the files in the cache are different in KB size from the saved files on the desktop folder. The dimensions of a saved image are the same but the size of the file differ. Now I can not use Double Killer to delete files and have to go through the whole cache directory one by one to find files that were not saved.
    Why did the Firefox developers changed the cache directory? Do I need to revert to a previous version of Firefox or is there a way that I can change the cache directory of Firefox 33.0.3 and the size that it stores files.
    Would also like to know what add-on gives the best quality screenshot with flash.
    Thanks for this support. Apart from this cache problem I find Firefox easy to use and the best web browser.

    Current Firefox 32+ releases use a new cache service named Cache2 and this cache service works differently.
    Files in the cache2 folder are special files that also store the meta data apart from the actual file data that you see on the about:cache page if you click an item.

  • How to get *.class file path....

    how could find the executable file path at execution time..
    if there is one *.class file, then i will paste it to another location . next i will execute that .class file. how to find that path from execution program ....

    Try the following
    URL path = getClass().getProtectionDomain().getCodeSource().getLocation();

  • Export class files?

    Hi
    I have a class file but not the .java file. Is there a way to uncompile the class file so I can rebuild the class?

    There are things called "Java decompilers" that can often do that. (Those two words are your search engine keywords.) Sometimes people will obfuscate their class files to prevent that from happening. But if you just screwed up and erased your source code (like I did once) then a decompiler shouldn't have much of a problem.

  • How to convert class files into java files??

    Hey Guys,
    I need a little help.
    I want to know wheather we can view .class files as .java files or convert the .class to .java files.Is ther any tool or software for doing that.
    Or in other words can i see the source code of any .class file..??
    Plz do tell me if we can do that or any other way we can do that.
    Regds,
    Gokul

    Sort of. A "decompiler" will take a class file and generate a source code file of source code that could be compiled to get the class file you started out with. However, it won't be the same source code that was originally used to create the class. Most notably, comments will be missing, and variable names will probably be meaningless.
    And before you say "java is bad because you can decompile it", note that any language that you can execute you can theoretically decompile.
    Also, you can view the raw byte codes. If you're familiar with assembly language, or better yet familar with java bytecodes and the JVM in particular, you can often find out what a particular method does just by viewing the byte codes.

  • "Save Class Files"

    Hi folks,
    I'm running CFMX6.1 with all the current updates loaded (...
    of that I'm about 99.9% sure...) and I'd like to know:
    What exactly is "Save Class Files" for under the CF
    Administrator mean?
    I know what the blurb by the checkbox says, but I don't
    understand the implications of that statement.
    Just as a referesher in case anyone forgot the little blurb
    says:
    quote:
    When you select this option, the class files generated by
    ColdFusion are saved to disk for reuse after the server restarts.
    Macromedia recommends this for production systems. During
    development, Macromedia recommends that you do not select this
    option."
    Here's my problem: we have two CF Servers
    (production/development) both running CFMX6.1, and when accessing a
    page on the production server, IE is caching it despite our
    cache-control template being included (standard template that sets
    the cache control meta tags, etc.). When I tried to reproduce this
    problem on the development server, I could not. I have IE set to
    check for new versions of the page on every visit and still I'm
    getting a cached page when I press the back button.
    I checked out the CF Administrator and the only difference in
    the Caching settings is the lack of a check mark on "Save Class
    Files" on the development box.
    Could enabling this feature cause page caching like I'm
    seeing?
    Thanks.
    Chris

    I'd just like to add that enabling "Save Class Files" in
    Production isn't always the best recommendation. (And I personally
    think Adobe should change this in the CFAdmin).
    The reason being:
    As Swathi says, when you have this option enabled, ColdFusion
    will load your class files from disk, meaning that after server
    restarts ColdFusion doesn't have to recompile your .cfm/.cfc files.
    What you need to be aware of however, is that if you are in
    the situation where you have a LOT of ColdFusion
    files/applications, this adds up to a lot of class files in the
    /cfclasses directory. We could be talking thousands, and
    potentially even tens of thousands.
    Where the problem arises is that when ColdFusion restarts and
    looks in /cfclasses, it may not find it and then have to recompile
    the ColdFusion file and then save it to disk. This can result in a
    lot of disk I/O as well as time spent searching the directory for
    the specific file.
    In these circumstances you are in fact better leaving the
    option disabled as the compile time will actually be quicker than
    the File I/O and search. Of course, the best way to find out which
    performs best is to test, test and test again.
    As an aside, the Save Class Files was a real must for CFMX6.0
    because the compiler that was used was ridiculously slow. With
    CFMX6.1 the compiler changed dramatically hence why Save Class
    Files isn't necessarily the best way to go.
    Co-incidentally, Macromedia.com has the option disabled.
    Hope that made sense?
    Andy

  • Class file size

    I think,Class file size is Always greater than Source file..
    What are the extra information stored in Class file ?
    If anybody knows, pls explain

    Actually this isnt entirely true. I have some class files that are 1/3 the size of the source, and some that have 5 class files for one source file. It is entirely based on what your using in it. If you use a lot of swing, your bound to have more class files per source file and their total size will be much larger than the source. Classes that use packages like java.io and not swing are the opposite. With swing it has to generate more data to run, since it is doing more things, like all of the painting.

  • Any way to reduce class file size?

    Somewhere during my travels on the net I remember seeing something about a utility that reduces the size of java class files, eg by optimizing. I think it is an IBM product. Anybody know about this?
    I am writing a midlet that needs to be less than 70K in size (JAR file), but currently its at about 100K -- any suggestions on how to reduce the size of the class files?
    Thx,
    Fred

    Yes, I think you are refering to JAX by IBM.
    I have just started using it a couple of days ago. It reduced my 130k application to 70k good tool.
    Here is the link :
    http://www.alphaworks.ibm.com/tech/JAX
    Look for verion 6.1 that on if free. The new version is very expensive $1000 :(.
    6.1 works well.

  • Does anyone have a simple program that will return the size of a file

    Does anyone have a simple program that will return the size of a file?

    I quite hate it when I receive the incorrect amount of yoctocandela per metre squared. Swarthy people
    can't properly convert poundal feet to barleycorn; throws off the whole conversion! Aaah, you get what
    you paid for.I recognize those figures; you've got your outsourced file sizes from Zanzibar; admit it! I always apply
    the scientific approach when I've got file sizes back from Zanzibar: I simply divide those numbers by
    pi (very scientific) and drop the eleven (ueber scientific, because 11 is prime even when looked upon
    as a binary number) least significant bits. And remember: never compare two floating point numbers
    for equality. (<--- that's a free tip)
    Jos ;-)

  • Specifying the size of a file when creating a new file

    How do I go about doing this? I specifically need to create different file sizes (2mb's all the way up to 10mb). I was poking around through the File class and there doesn't seem to be a way to do this. There is a way to get the size of it in bytes, but no way to create an empty file straight off the bat with the file size specified. Does anyone know how to do this?
    Thanks.

    the reason I want to do this is because I need to pass certain file sizes over a network and see if the system can handle the sizes of the file under load. the files dont necessarily have to be empty, they can be filled with a bunch of jibberish, but I figured it would be easier to be able to just specify the size of the file rather than have a loop that loops and places over 2 million characters into a file. because a 2mb file is going to be the smaller of the files that needs passed through and that will take too long to create.
    and thanks for the link to randomaccessfile. im probably going to use that, just specify the file size and be done with it. unless theres a better way to do it, but i cant find anything.

  • Signing class files

    Dears,
    Is there any possiblity to sign the class files instead of jar files.
    Esakki

    Hi,
    why do you want to sign the class file?
    Using a jar file you'll have all the classes into one single file and you'll have all the classes signed, and then you won't need to sign every single class, you'll do once and no more.
    Moreover, using the JAR type file, your classes will have smaller size and so they load up faster.
    See you

  • Size of the file ?

    I wanted to know how can you get the size of the file when you have the filename and filepath with you ?
    -Gada

    If you use the class NSFileHandle, you can send the file -availableData message returning an NSData, from there, you can send it a -length message and that will return the size in bytes of the file.

  • Why is U51 blocking individual class files not in jars but U45 accepted them?

    Let me answer the "why do you need individual class files?" question first. We have a rather large applet based application with a current client-side minimum jar download size of 1.8 MB. If we put ALL of our class files into jars, that size will probably double. Most users only use a small portion of the class files for their particular tasks. Which of the class files they use depends upon the tasks they perform. Having ALL users download ALL the classes, albeit compressed in jars, is extremely time consuming and a major problem after application updates due to the large number of users and the network load it would cause.
    Jar file manifest:
    Permissions: all-permissions
    Codebase: *
    Application-Name: MyApplication
    Application-Library-Allowable-Codebase: *
    Caller-Allowable-Codebase: *
    Trusted-Library: true
    We have 11 directories with one containing the applet and main client application code. The other 10 directories contain class files relating to the various sub-applications in the system. The system has a third-party runtime jar file, too.
    We have a private network and servers for our business so the exposure is small. This is a screen-scraping, reformattring application that does no real data processing so doesn't need the same security as a true data processing application. Since we are not open to the Internet and of limited security risk, we chose to keep a more simplified structure.
    This all worked under 1.7.0_45. I read the security guide and it was my understanding that these attributes in the manifest would also work for U51. Apparently not. Looking at the guides, now, it appears they have been changed sometime last year regarding mixed-code to mean jars with certificates and jars without certificates. The support for individual class files appears to have been removed. If this is true, then there should have been a beta of the U51 code because the rules seem to have been changed since the last release or there is a new bug.

    This is exactly my same problem. My app (and applet) is about 5 MB if I consider all the classes and libraries used by the app. (I mean 5MB is the size of the jar file). I can't ask customers to download 5 MB every time they want to access the program.
    We need java ask code signing for the principal applet but then we must have the possibility to run single class files as needed.
    Help us all please.
    Thanks Paolo

  • Time estimation of a class file without execution

    Can any body help me....
    I have to find the execution time of class files without execution.
    can I do it with java...!!!!!!!!!!

    Presumably this is a class assignment and not a work assignment. If it is for work then either ask for justification for this stupidity or start playing games and looking for another job.
    Use javap and count the byte codes. Each byte code has a size so give a execution time of n X size. Each branch has a execution time of n X size + 1 (since it take longer.) Each method call is n X size + 2 (a goto and a return.)
    'n' in the above is an arbritrary constant.
    Each method is the sum of its contents. If you have a loop that calls a method you have to estimate the average loops and use that multiplied by the method count.
    For system methods you will just have to list them and give each a unknown time, since presumably you aren't analyzing everything.

Maybe you are looking for

  • Need to Open Two Windows at the same time

    Hi All , I have a requirement wherein I am opening a new page when the user presses a link . The information displayed to the user in the new page is Read-Only.To display the reqd info on the new page I pass some parameters encoded in the page call U

  • TS2771 reset my ipod touch and it wont turn on

    ??????????????

  • Ipod notes & text file splitting

    Does my Ipod support the HTML code in my txt files? How I can split in txt's file of 4 kb my e-book?Is there any program to do that?Is there any special function using the ipod notes?Thank you.

  • Is the "Import" function temporary?

    I think I may have lost several hours of footage. First of all, in haste in buying a camera for my son's birth two years ago, I picked up a Sony AVC-HD SR-5 and later found out that it was not the best choice for iMovie. Long story short... I've sinc

  • Thread is running even after calling iterrupt

    Hi, I have a strange problem in Oracle Full Suite 10.1.3. I have a thread class which is having a private attribute as keepAlive. Start methode of this file is calling another method and this method is checking value of keepAlive. Here is the sample