Which of the following will take more memory?

Hi All,
which of the following will take more memory:
---this-----
long longval[] = new long[100];
String strval[100] = new String[100];
boolean boolval[100] = new boolean[100];
---or this-----
class Data {
long longval;
String strval;
boolean boolval;
Data data = new Data[100];
I heard objects will take up more memory than default datatypes. I'm looking for speed and memory optimization, so even the slightest of memory saving will matter.

Hi,
the first one needs less memory, I guess - beside the point, that the second one has 100 additional references, is the fact, that allocation of memory on modern machines is not a continous one - new data blocks are arranged so, that they start on even addresses (it's a performance issue) often clustered in multiples of 16, 32 or 64. So if you allocate a lot of single objects, the average loss of memory with each object is 8,16 or 32 Bytes (half the cluster size).
The first one allocates 3 compact data blocks (arrays) - so 3 times the additional loss of memory takes place. The second one allocates 101 blocks (100 objects + 1 array), and so 101 times the additional loss of memory takes place.
greetings Marsian

Similar Messages

  • Which of the following will exactly copy a file in Photoshop CS5?

    Which of the following will exactly copy a file in Photoshop CS5?

    Just answer A to all the questions on your exam.  You'll probably get an A.  Honest. 
    Seriously, put your smart phone down and engage your brain.  I'll bet you really can get an A if you concentrate.
    -Noel

  • Ou are working with multiple open files and wish to separate them into movable windows. Which of the following will accomplish this?

    Which of the following will exactly copy a file in Photoshop CS5?

    Which of the following will exactly copy a file in Photoshop CS5?

  • How do I create my own favorite template for DVD slideshows? I used to be able to select this from pulldown menu, but cannot now do so. I am directed straight to templates, which take more memory. I have a large slideshow, and need all the space I can get

    First, how do I create my own favorite theme template for DVD slideshows? I used to be able to select this from pulldown menu, but cannot now do so. I am directed straight to already existing themes, which take more memory. I have a large slideshow, and need all the space I can get. I just want to use a picture as my DVD cover, and then insert a slideshow. Also, when I try to burn my 8.5gb double sided slideshow, all that burns is the music. It is a large slideshow, a memorial on the life of my now deceased brother. This means a lot to me and to my family, and I am having so much trouble trying to burn it. I have gone into Project View and selected appropriately. The bar shows I have room to burn this DVD, but it does not burn.  I have burned so many DVDs in the past, but this one just will not burn. I am so confused at this point. I will say this is the first 8.5gb I have attempted to create and burn. My specs list a 7.7gb or 4.7gb as operable....but there are no 7.7gb dvds. I had to purchase 8.5gb. Help? What am I doing wrong? I have spent so much time on this, and just cannot figure it out.

    Final Cut is a separate, higher end video editor.  The pro version of iMovie.
    Give iPhoto a look at for creating the slideshow.  It's easy to assemble the photos in an album in iPhoto, put them in the order you want and then make a slideshow of them.  You can select from various themes and transitions between slides and add music from your iTunes library.
    When you have the slidshow as you want use the Export button at the bottom of the iPhoto window and export with Size = Medium or Large.
    Save the resulting Quicktime movie file in your Movies folder.
    Next, open iDVD, choose your theme and drag the QT movie file into the menu window being careful to avoid any drop zones.
    Then follow this workflow to help assure the best qualty video DVD:
    Once you have the project as you want it save it as a disk image via the File ➙ Save as Disk Image  menu option. This will separate the encoding process from the burn process. 
    To check the encoding mount the disk image, launch DVD Player and play it.  If it plays OK with DVD Player the encoding is good.
    Then burn to disk with Disk Utility or Toast at the slowest speed available (2x-4x) to assure the best burn quality.  Always use top quality media:  Verbatim, Maxell or Taiyo Yuden DVD-R are the most recommended in these forums.
    The reason I suggest iPhoto is that I find it much easier to use than iMovie (except for the older iMovie 6 HD version).  Personal preferences showing here.

  • I have the Ipod Nano. I'm traveling to Australia which has the following current: 240V AC, 50Hz. I have a travel plug adapter for the Australian electric sockets. Will I be able to use my Ipod charger with an Australian travel plug adapter or will I also

    I have the Ipod Nano. I’m traveling to Australia which has the following current:240V AC, 50Hz. I have a travel plug adapter for the Australian electricsockets. Will I be able to use my Ipod charger with an Australian travel plugadapter or will I also need a voltage converter? Australia which has thefollowing current: 240V AC, 50Hz.

    I have the Ipod Nano. I’m traveling to Australia which has the following current:240V AC, 50Hz. I have a travel plug adapter for the Australian electricsockets. Will I be able to use my Ipod charger with an Australian travel plugadapter or will I also need a voltage converter? Australia which has thefollowing current: 240V AC, 50Hz.

  • When I open itunes, I have the following message : a more recent version of this app already exists in your itunes library. Do you really want to replace it by the one you move ?

    When I open itunes, I have the following message : a more recent version of this app already exists in your itunes library. Do you really want to replace it by the one you are moving ? How can I get rid of this message which appears for at least 20 app out of 90 ?

    When I open itunes, I have the following message : a more recent version of this app already exists in your itunes library. Do you really want to replace it by the one you are moving ? How can I get rid of this message which appears for at least 20 app out of 90 ?

  • Why view have no stored data ?  And what is the reason view take more time

    Why view have no stored data ? And what is the reason view take more time to query ?
    what happen if a view have stored data?

    user12941450 wrote:
    I want to know the reason that why querying view is slower then querying a normal table?..Untrue.
    For example take a table with 2laks record and a view for that table.
    If i make a query like( Select name,address from table) then it works fast then select(name,address)from view..Incorrectly interpreting the results.
    A view is a SQL statement. Only difference is that the SQL statement is stored in the database's dictionary. Let's consider the following view:
    create or replace view foo_view as select * from empWhen you use the view as follows:
    select * from foo_viewOracle sees it as follows:
    select * from (select * from emp)This is no slower, or no faster, than providing the following SQL to Oracle:
    select * from empSo if you observe a difference in performance between using plain SQL versus using that same SQL via a view, there are other reasons for that difference in performance. The reason is NOT that views are slower.

  • Which of the following is required for multiple Company Codes assigned to s

    Which of the following is required for multiple Company Codes assigned to same Company ?                                   
    Same Chart of Accounts                                   
    Same Currency                                   
    Same Fiscal Year

    hi,
    if multiple companies are dependent on each other then you have to follow the below as same for all companies.
    Same CoA
    Same ItemMaster Data
    Same WareHouses
    Same BP Master Data
    Same Currency
    same fiscal year
    and few more master datas which ever necessary.
    if they are independant on each other then no need to maintain the same codes.
    regards,
    varma

  • When I close my iPhone and I want to open it to use it again, the opening process takes more than an hour, I regretted to buy the iPhone because of this problem that you do not suffer at all with Nokia,how I can solve this problem?

    When I close my iPhone and I want to open it to use it again, the opening process takes more than an hour, I regretted to buy the iPhone because of this problem that you do not suffer at all with Nokia,how I can solve this problem?

    mostafa182 wrote:
    ... how I can solve this problem?
    The Basic Troubleshooting Steps are:
    Restart... Reset... Restore from Backup...  Restore as New...
    Restart / Reset
    http://support.apple.com/kb/ht1430
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414
    If you try all these steps and you still have issues... Then a Visit to an Apple Store or AASP (Authorized Apple Service Provider) is the Next Step...
    Be sure to make an appointment first...

  • In which of the following sections of a PL/SQL block is a user-defined exception raised?

    Hi,
    A (somewhat elementary) question:
    In which of the following sections of a PL/SQL block is a user-defined exception raised?
    a) Exception section
    b) Declarative section
    c) Error handling section
    d) Executable section
    I'd be interested to hear people's answers.
    Thanks.

    As Etbin already noted, there are only 3 sections and user-defined exception can be raised in any of them. User-defined exception raised in declarative section example:
    declare
        year_zero exception;
        pragma exception_init(year_zero,-01841);
    begin
        declare
            v_dt date := to_date(1721420,'j');
        begin
            null;
        end;
      exception
        when year_zero
          then
            dbms_output.put_line('Year 0!');
    end;
    Year 0!
    PL/SQL procedure successfully completed.
    SQL>
    User-defined exception raised in executable section example:
    declare
        year_zero exception;
        pragma exception_init(year_zero,-01841);
        v_dt date;
    begin
        v_dt := to_date(1721420,'j');
      exception
        when year_zero
          then
            dbms_output.put_line('Year 0!');
    end;
    Year 0!
    PL/SQL procedure successfully completed.
    SQL>
    User-defined exception raised in exception handling section example:
    declare
        year_zero exception;
        pragma exception_init(year_zero,-01841);
        v_dt date;
    begin
        declare
            v_num number;
        begin
            v_num := 1 / 0;
          exception
            when others
              then
                v_dt := to_date(1721420,'j');
        end;
      exception
        when year_zero
          then
            dbms_output.put_line('Year 0!');
    end;
    Year 0!
    PL/SQL procedure successfully completed.
    SQL>
    SY.

  • Which of the following are true about abstract methods in EJB 2.0

    Hi guys I'm beginner to EJB and i got some unanswered questions.
    Can any one of you please.. give answers?
    Thanks if you do...
    Which of the following are true about abstract methods in EJB 2.0
    CMP?
    Choose all correct answers:
    1. Abstract accessor methods should not be exposed in the EJB
    component's interface
    2.Abstract accessor/mutator methods are used to access and modify
    persistent state and relationship information for entity objects
    3.Abstract Accessor/Mutator methods do not throw exceptions
    4.The EJB developer must implement the Accessor/Mutator methods
    5.Abstract accessor methods may or may not be exposed in the EJB
    component's interface
    2.Which ONE of the following is true?
    Choose the best answer:
    1.Local interfaces cannot have a relationship with other Entity
    components
    2.Local interfaces cannot be used for Stateless Session EJB
    3.Local interfaces can be a part of Object's persistent state
    4.Local interfaces have the same functionality as that of a
    stateless Session EJB
    3.Which of the following describe the <cmr-field> in a EJB 2.0
    descriptor?
    Choose all correct answers:
    1.A Local interface/Entity can be a value of a <cmr-field>
    2.There is no <cmr-field> in EJB 2.0 descriptor
    3.It is used to represent one meaningful association between any
    pair of Entity EJBs, based on the business logic of the Application
    4.It provides a particular mapping from an object model to a
    relational database schema
    5.It allows the Local Entity interfaces to participate in
    relationships
    4.Which of the following are the advantages of using Local interfaces
    instead of dependent value classes?
    Choose all correct answers:
    1.Local Entity Interfaces can participate in Relationships
    2.The life cycle of Local Entity Interfaces is managed by EJB
    container, intelligently
    3.Local Entity Interfaces can be used in EJB QL Queries
    4.Local Entity Interfaces can be a part of the <cmp-field> but not
    <cmr-field>
    5.Which of the following are true about Local interfaces
    1.A local interface must be located in the same JVM to which the EJB
    component is deployed
    2.Local calls involve pass-by-reference.
    3.The objects that are passed as parameters in local interface
    method calls must be serializable.
    4.In general, the references that are passed across the local
    interface cannot be used outside of the immediate call chain and must
    never be stored as part of the state of another enterprise bean.
    6.Which of the following specifies the correct way for a client
    to access a Message driven Bean?
    Choose the best answer:
    1. via a Remote interface
    2. via Home interface
    3. Message driven bean can be accessed directly by the client
    4. both 1 & 2
    5. none of the above
    ------------------------------------------------------------------------7.Which of the following statements are true about message-driven
    bean Clients?
    ------------------------------------------------------------------------Choose all correct answers:
    They can create Queue and QueueConnectionFactory objects
    They can create Topic and TopicConnectionFactory objects
    They can lookup the JNDI server and obtain the references for
    Queue and Topic and their connection Factories
    Only 1 and 2 above

    Hi guys I'm beginner to EJB and i got some unanswered
    questions.
    Can any one of you please.. give answers?
    Thanks if you do...
    Which of the following are true about abstract methods
    in EJB 2.0
    CMP?
    Choose all correct answers:
    1. Abstract accessor methods should not be exposed
    d in the EJB
    component's interfacefalse
    2.Abstract accessor/mutator methods are used to
    access and modify
    persistent state and relationship information for
    entity objectstrue
    >
    3.Abstract Accessor/Mutator methods do not throw
    exceptionstrue
    >
    4.The EJB developer must implement the
    Accessor/Mutator methodsfalse
    5.Abstract accessor methods may or may not be exposed
    in the EJB
    component's interfacetrue
    2.Which ONE of the following is true?
    Choose the best answer:
    1.Local interfaces cannot have a relationship with
    other Entity
    componentsfalse
    2.Local interfaces cannot be used for Stateless
    Session EJBfalse
    3.Local interfaces can be a part of Object's
    persistent statefalse
    4.Local interfaces have the same functionality as
    that of a
    stateless Session EJBtrue
    3.Which of the following describe the <cmr-field> in a
    EJB 2.0
    descriptor?
    Choose all correct answers:
    1.A Local interface/Entity can be a value of a
    <cmr-field>true
    2.There is no <cmr-field> in EJB 2.0 descriptorfalse
    3.It is used to represent one meaningful association
    between any
    pair of Entity EJBs, based on the business logic of
    the Applicationtrue
    4.It provides a particular mapping from an object
    model to a
    relational database schematrue
    5.It allows the Local Entity interfaces to
    participate in
    relationshipstrue
    4.Which of the following are the advantages of using
    Local interfaces
    instead of dependent value classes?
    Choose all correct answers:
    1.Local Entity Interfaces can participate in
    Relationshipsis
    2.The life cycle of Local Entity Interfaces is
    managed by EJB
    container, intelligentlyis
    3.Local Entity Interfaces can be used in EJB QL
    Queriesnot
    4.Local Entity Interfaces can be a part of the
    <cmp-field> but not
    <cmr-field>not
    >
    >
    5.Which of the following are true about Local
    interfaces
    1.A local interface must be located in the same JVM
    M to which the EJB
    component is deployedtrue
    2.Local calls involve pass-by-reference.true
    3.The objects that are passed as parameters in local
    l interface
    method calls must be serializable.false
    4.In general, the references that are passed across
    s the local
    interface cannot be used outside of the immediate
    e call chain and must
    never be stored as part of the state of another
    r enterprise bean.true
    >
    6.Which of the following specifies the correct way for
    a client
    to access a Message driven Bean?
    Choose the best answer:
    1. via a Remote interfacefalse
    2. via Home interfacefalse
    3. Message driven bean can be accessed directly by
    the clientfalse
    4. both 1 & 2false
    5. none of the abovetrue.
    >
    ----------------7.Which of the following statements
    are true about message-driven
    bean Clients?
    ----------------Choose all correct answers:
    They can create Queue and QueueConnectionFactory
    objectsthe container can, dunno bout clients
    >
    They can create Topic and TopicConnectionFactory
    objectsthe container can, dunno bout clients
    >
    They can lookup the JNDI server and obtain the
    references for
    Queue and Topic and their connection Factories
    true
    Only 1 and 2 abovefalse
    somebody correct me if i'm wrong

  • Using the warp tool I'm stabilizing  my video and getting rid of the edge artifacts. Analyizing is clear on how long the process will take, but when it stabilizes I only get three moving dots. I there a way to know when the process will stop? Thanks.

    I am using the warp tool to stabilize my video and get rid of the edge artifacts.  The program is very clear about how long it will take to analyze, but there is nothing about how long the stabilization will take nor when I know when it is complete.   Thanks ahead of time.

    Warp Stabilising is a two part process.
    Analysis and Stabilising.
    Both have a banner across the Program Monitor during the process ( unless you have turned that off.
    Analysis start automatically on forst application...but you can rock in there and start adjusting the parameters.
    You may need to hit "Analyse" Button again.
    You should see the number of frames and the estimated duration during this process.

  • When recording a Video demo slide in Captivate 8, pressing the [END] key takes more than a minute to stop the recording. Why is there such a lag?

    When recording a Video demo slide in Captivate 8, pressing the [END] key takes more than a minute to stop the recording. Why is there such a lag? Additionally, the software I record experiences terrible lag times. For instance, It may take 15 seconds to display a 2-digit number I typed into a blank field. the same software has no lag issues when I'm not recording it.

    Yes and no. The CPTX file is on my PC. Our software that I'm making the demo of is on the network. but I'm not the "IT Guy" so I can't provide specifics; however, I work at a computer software company and we probably have more servers than employees. The network hardware is kept current. I've been making similar tutorials for 10 years and haven't run into this issue until switching to the subscription Captivate.

  • Which of the following cpu coolers will fit on my mobo(p965 neo f)?

    hi guys
    im looking to replace the stock hsf and the following is wht ive narrowed it down to:
    1.thermalright
    ultra 90a
    ultra 120
    ultima 90i
    2.cooler master hyper tx2
    3.scythe ninja plus rev b
    ive got a 9600gt and 2 1gb ram sticks in dual channel configuration not a very big case, there is about 3-4 cms between the stock heatsink and the psu and about 13-14 cms of height available with the side panel closed.
    thanks in advance

    Hi,
    I use a Thermalright Si 128 on a P965 Platinum mainboard.
    http://www.thermalright.com/new_a_page/product_page/product_cpu_cooler.html
    This was due to "higher" northbridge HS, but the added benefit of air being circulated down to surrounding socket area.

  • Camera takes more memory than it should

    I deleted a load of music and photos to update to the ISO 8 and half way through the update it cut out and restarted my phone
    found out the reason it stopped was because i don't have enough memory on my phone (which I did before the update)
    the culprit seems seems to be my camera roll. All I have is 284 things in it (inc vids and pics) and that takes up 4.1gb of memory. I can't remember what the memory was before it cut out but it can't have been that much because I was able to initially start the update
    is there anything I can do without connecting to iTunes on my laptop as my laptop is broke and if I plug my iphone into my girlfriends then my phone will be wiped (that's what I presume anyway as it happened before)
    thanks for taking the time to read this and any help will be greatly appreciated

    That MacBook Pro should be plenty of power for iMovie. However, she will likely need an external drive to hold her Events.
    Assuming that she has a high definition AVCHD camcorder, the camcorder will record in a highly compressed format called AVCHD. It will about 1 full frame of high definition video per second. The rest of the frames contain information like "what has changed since the last frame?", what is the direction of motion?, etc.
    This is great for capture, but not so good for editing, because you might want to edit starting at one of the compressed frames.
    When you import AVCHD to iMovie, it converts all the frames into full frames. This way you can edit any frame without a big load on the processor. This means that when you import, the file size will be about 10x bigger than it was on the camera.
    She will need an external drive. It must be formatted as MacOS Extended (journaled). You can buy them off the shelf like this, or you can buy a FAT32 drive and reformat it with Disk Utility.
    I recommend that you start with a 1TB drive that connects with Firewire 800, FW400, or USB.

Maybe you are looking for

  • Snow Leopard Server - Can't delete users in WGM?

    Hi! I have 2 Mac OS X Server 10.6.4 machines. One is an OD-master and the other is a replica. Since last week I haven't been able to delete user accounts in WGM. It doesn't give me any error and at first glance it looks like the account is deleted, b

  • Whats the use of having pragma autonomous transaction

    Hii All, The below is the procedure developed by our predecessors.We are making use of this for writing our debug messages. I'm aware of pragma autonomous transaction ,this allows my code to run independently of the calling program. But here we are j

  • Permission issues with CRM Business packages

    Hello I have imported CRM business packages 5.0 to EP7 Portal. created System object SAP_CRM.connection is fine. Assigned predefined CRM roles(Content provided by SAP)to new users.but when I click on the CRM iview, getting following error. Portal Run

  • MIME object/Image(JPG) not displayed in the WAD template

    Hello all, I uploaded a .JPG file to mime repository. I used that object my WAD template. When i excute the Temapate, image file is not displayed just showing X mark. But i am able to open/see the file from the mime repository. What could be the prob

  • Cannot install cloud or photoshop

    The cloud application won't install and when I try to install photoshop I get unsupported version of my mac os which is 10.6.8