How can i get size of a class?

is there any way to find a size of class? like
sizeof(struct stu) in c language

Yes you can with 1.5 using http://java.sun.com/j2se/1.5.0/docs/api/java/lang/instrument/Instrumentation.html
It is not straight forward process. You have to create your own agent:
package foocompany.agent;
public class SimpleAgent {
   private static Instrumentation instrumentation;
   /** Creates a new instance of SimpleAgent */
   public SimpleAgent() {
   public static void premain(String agentArgs, Instrumentation inst) {
      instrumentation = inst;
   public static long sizeOf(Object object) {
      return instrumentation.getObjectSize(object);
}Create a manifest file:
Manifest-Version: 1.0
Premain-Class: foocompany.agent.SimpleAgentCombine them into a jar file.
And then specify the jar file on the command line:
java -javaagent:"<path to jar>\simpleagent.jar" <rest of arguments...>
Then you can call SimpleAgent.sizeOf() on any object from your program.

Similar Messages

  • How can Client get a ejb remoteinterface class through ejbhomeinterface?

    HI,I've got ejbhomeinterface class(ejbhomeinterface class is on my local machine),How can i get ejb remoteinterface class(it is on remote app server) ? I've tried
    getEJBMetaData() method, but throw class not found exception,pls help me,thank you very much!!
    Object ejbObj = null;
    Class remoteClass = null;
    EJBHome aHome = null;
    try{
    aHome = (EJBHome) javax.rmi.PortableRemoteObject.narrow(aHome, EJBHome.class);
    EJBMetaData metaData = aHome.getEJBMetaData();
    // Class homeClass = metaData.getHomeInterfaceClass();
    aHome = metaData.getEJBHome();
    remoteClass = metaData.getRemoteInterfaceClass();
    //following code i want use remoteClass invoke remote ejb mothod
    }catch(Exception e)

    may be you need create InitialContext first, than from InitialContext lookup Home interface. And than using home.create() get RemoteInterface and use it.

  • How can I get size of fetched data size when run a SQL ?

    Hi,
    When I run a SQL how can I get fetched data size?
    regards,

    We can get it using some calculations:
    1. SQL%ROWCOUNT attribute will fetch you number of rows returned in a SQL statement.
    Problem-->Now you need to get the size of 1 row.
    Solution-->
    Step 1.We can get size of table from dba_segment data dictionary.
    Select block_size from dba_segemnts where segment name like '%YOURTABLE%';
    Step2 . Get count of rows in your table
    Select count(*) from YOUR_TABLE
    Step 3.
    Get size of 1 row--> Divide result in Step1 by result in Step 2.
    Required result--> multiple result in step3 with SQL%ROWCOUNT..
    I hope this is what u want.

  • How can I get size of a Cluster in Bytes?

    I want to get the value of a cluster size, and I found the function 'Get Variant Attribute'  that I think can do this,
    but I can't find in the documentation http://zone.ni.com/reference/en-XX/help/371361D-01​/glang/get_variant_attribute/
    Could anybody provide the values that the attribute name can receive?
    And this is the right function to get what I need or there is other way?
    Solved!
    Go to Solution.

    Hi Marco,
    GetVariantAttribute cannot give you the size of a cluster - it will give just you the attribute(s) of a variant!
    You can create attributes with any name (but not empty string)...
    Why do you need the bytesize of a cluster?
    Maybe you could serialize it into a string and get the string length. Or typecast to an array of U8 and get the arraysize...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How can i get a java executable (*.class) run on a web browser?

    I have created a simple appilcation in java and i would like to view it through a web browser.
    In order to do so, do i need to use an application server or just a web server?
    Can you come up with another solution to solve my problem(view the java application through the web)?
    Thank you in advance.

    If it HAS to be an application (perhaps something you have already written and now need to distribute), then Java Web Start may be an option.
    What is your user base? How many people will be using it? In what environment? How frequently will they use your app? I think you mentioned that it needs to read files. Is that on the user's machine?
    You may be able to create an applet version of your application using the same logic but subclassing some of the components to allow for remote login etc.

  • How can I get the edited pictures from the thumbnails to full size?

    I upgraded to iPhoto 11, the thumbnail photos show my previous edits, but when I click on the photo to make it bigger, it reverts back to the unedited, original picture.  How can I get the edited pictures from the thumbnails to full size?

    Verify you are using iPhoto11 ver 9.5
    if not run the >Software update or check your apps folder and make sure the correct iPhoto is launched,  not an older ver.

  • How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?

    How can I get the "Open" and "Save As" dialog boxes to open at larger than their default size?  I would like them to open at the size they were previously resized like they used to in previous operating systems.  They currently open at a very small size and the first colum is only a few letters wide necessitating a resize practically every time one wants to use it.  Any help would be appreciated.

    hi Prasanth,
    select werks matnr from ZVSCHDRUN into table it_plant.
    sort it_plant by matnr werks.
    select
            vbeln
            posnr
            matnr
            werks
            erdat
            kbmeng
            vrkme
            from vbap
            into table it_vbap
            for all entries in it_plant
            where matnr = it_plant-matnr and
                  werks = it_plant-werks.
    and again i have to write one more select query for vbup.
    am i right?

  • E mail bt print very small and i cannot change it. how can I get my e mails to print readable size

    HOW CAN I GET MY E MAILS TO PRINT TO READABLE SIZE. BT YAHOO WINDOWS 7 HOME PREMIUM HP DESKJET F2480
    NO FONT AVAILABLE TO CHANGE SIZE TO PRINT TO READABLE SIZE EG FONT SIZE 12 OR 14. DISPLAYS ON ABOUT SIZE 8
    ALSO HAVE TO CLICK FULL VIEW TO READ. THIS HAS SUDDENLY APPEARED, DID NOT HAVE FULL VIEW ETC BEFORE .

    Go to the following address: https://account.services.mozilla.com/
    If you DO NOT remember your password, press the "Forgot your password?" link and it will be sent to the e-mail address that you used for registration.
    Enter your e-mail address and your password. Follow any additional prompts. '''This should remove your account and all Sync data associated with your account from the servers.'''
    Then, set up a new account.
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''

  • I am trying to update my time machine backup on time capsule, but time machine keeps trying to create an entirely new backup (evidenced by the 200GB backup size). How can I get time machine to modify my old backup rather than create a new one?

    I am trying to update my time machine backup on time capsule, but time machine keeps trying to create an entirely new backup (evidenced by the 200GB backup size). How can I get time machine to modify my old backup rather than create a new one?

    It must have found the old backup corrupt.. so you will more than likely have little choice. You can archive off the old backup if it is still useful.
    You can also verify it. See A5 http://pondini.org/TM/Troubleshooting.html
    He also has some info on this problem. eg C13.

  • Only the first page is printed reduced as setup. All pages afterward are full size with information cut off. Recent problem. Can print from Safari just fine. How can I get all pages to be reduced size?

    Question
    Printing internet pages
    Reduced print size
    Only the first page is reduced and printed as desired
    All pages after the first page are full size with information cut off
    Recent problem never seen before
    Can print from Safari and other software just fine
    How can I get all pages to be reduced size?

    One suggestion worked from the Firefox prints incorrectly link mentioned above by mha007. I'm thrilled since this has been annoying me for weeks. Thanks mha007!
    Reset all Firefox printer settings
    # Open your profile folder:
    # On the menu bar, click on the Help menu and select Troubleshooting Information. The Troubleshooting Information tab will open.
    # Under the Application Basics section, click on Show in Finder. A window with your profile folder will open.
    # Note: If you are unable to open or use Firefox, follow the instructions in Finding your profile without opening Firefox.
    # On the menu bar, click on the Firefox menu and select Quit Firefox.
    # In your profile folder, copy the prefs.js file to another folder to make a backup of it.
    # Open the original prefs.js file in a text editor (such as TextEdit).
    # Remove all lines in prefs.js that start with print. and save the file.
    # If something goes wrong when you open Firefox, close it again and overwrite prefs.js with the backup you made.

  • Than how can i get java class by using it's class file?

    Hi
    After compilation of a java program, it creates a class file.
    After getting class file suppose class file has been deleted.
    Than how can i get java class by using it's class file?
    Thanks in advance.

    get a decompiler and run your class file through it--I'll assume you want the source code back and that you are not trying to recover a missing class file by attempting to use the class file that is missing--if it's missing, then I've not a clue on how to get it back by using what is already missing.
    BTW: many of your compilers have source control--if it does, just restore your missing file.

  • How can I get my Pro-100 to print 12x12 page size? It won't let me set that size.

    I use 12x12 paper for scrapbooking.  Every time I set the paper size for 12x12, the printer says to choose the A3 size (11 x 16).  But then there's a wide margin of white left over.  How can I get the printer to print edge to edge?

    You need to buy a paper trimer.  Office Depot has several to choose from.  Believe me and save your self a lot of headache and just get the trimmer.  Print what you want on a larger size paper that the Pro-100 accepts and trim away.
    Are you using a post editor like Photoshop Elements?  If not I highly recommend you buy it, too.  There are others, some are even free, but PSE is the best.
    EOS 1Ds Mk III, EOS 1D Mk IV, EF 50mm f1.2 L, EF 24-70mm f2.8 L,
    EF 85mm f1.2 L II USM, EF 70-200mm f2.8 L IS II,
    Sigma 120-300mm f2.8 EX APO, Photoshop CS6, ACR 9, Lightroom 6

  • My iPhone 5 has a grey-ish blue splodge on the screen. What is it and how can I get rid of it? The place that has the spot is about the size is about 2cm,it still works where the spot is. I haven't sat on my phone or hit it to hard, not that I remember.

    The place that has the spot is about the size is about 2cm,it still works where the spot is. I haven't sat on my phone or hit it too hard, not that I remember.  I  noticed a while ago. Will it disappear? I can see the things that should be where the spot is eg it's on the keyboard and I can see the keys. Will this spread to the whole screen? How can u get rid of this?

    If you own an iPhone that is ineligible for warranty service but is eligible for Out-of-Warranty (OOW) Service, Apple will service your iPhone for the Out-of-Warranty Service fee listed below.
    iPhone model
    Out-of-Warranty Service
    iPhone 5s, iPhone 5c,
    iPhone 5
    $269
    iPhone 4s
    $199
    iPhone 4, iPhone 3GS,
    iPhone 3G, Original iPhone
    $149
    A $6.95 shipping fee will be added if service is arranged through Apple and requires shipping. All fees are in U.S. dollars and are subject to local tax.

  • When making a photo book, my iPhoto freezes during uploading the book to the store after assembly.  I have attempted this 4 times now and I don't know what to do! I know the file size is massive due quantity of large images. How can I get past this?

    When making a photo book, my iPhoto freezes during uploading the book to the storey.  I have attempted this 4 times now and I don't know what to do! I know the file size is massive due quantity of large image files, but I don't want to reduce the image file size and compromise quality in the book. How can I get past this?
    My macbook air is os x 10.9, using iPhoto 11 9.5 (902.7).

    Try Old Toad's solution here:   See   Re: iphoto : upload impossible to print a book
    Try to boot into Safe Mode and order this way, or sign into a different user account and try to order as a different user.
    Léonie

  • I have a question about the new version of itunes. in the old version at the bottom of the sceen it display the total number of media and the size of the files. how can i get the new version to diplay this?

    in the old version at the bottom of the sceen it displayed the total number of media and the size of the files. how can i get the new version to diplay this?

    You're welcome. It was frustrating for me as well until I stumbled across "the fix"

Maybe you are looking for

  • Adobe acrobat x and 9 professional convert landscape to portrait in Mac 10.6

    Dear all, 1) I have using MAC 10.6 with Adobe 10 prof . My problem is even i print the landscape document in to my application the preview switched to portrait. 2) Even i print the pdf document through adobe pdf printer.But i couldnot save the pdf fi

  • Overhead and settlement in WIP

    Hello, We have a material and COGM for that is: 2000 and COGS is 2400. But we are updating the COGM only to Material master as standard price. When we run the WIP and Settlement system is showing 400 as difference and it is going to Price Difference.

  • Converting date format yyyy-mm-dd to mm/dd/yyyy

    Hi, I need help converting the above date format. In the database the date is stored as a VARCHAR with the format yyyy-mm-dd but I would like it changed to DATE with the format mm/dd/yyyy. I tried the following and I keep getting invalid month select

  • Create MS Office Word document

    I want to create a MS Office Word document. Can someone tell me how to that?

  • Best practices for NAT/PAT?

    Greetings: My setup is Cisco 1811 serving as a router/firewall to several windows 2003 servers at an ISP. Ive configured NAT on the router to expose http, https, and smtp ports on each of the servers to a unique public ip address within my x.x.x.230/