Will passing object as parameter increase memory usage?

Hi,
Will passing an object as a parameter increase the mmory usage? will it affect the performance of the application any means. Please share your view.
Regards,
A.

Ananth.durai wrote:
Hi ,
Just to precise my question, suppose i have an object called Student.I want to pass the Student Object to a method called addStudent().Now rather than passing Student Object, i am passing it's super class "Object". (i.e)
addStudent(Object object) instead of addStudent(Student student)will it make any difference in performance?Those are declarations, not method passing. You'd still be passing the same thing, if it's just a question about how you declare the method.
And it will make no difference in performance, except when you start getting bugs. You might start getting bugs because you declared the parameter with a more general type than is really necessary. If the method takes a Student, then declare it as taking a Student. Making it say it takes an Object will just make things worse.
But as per Cogniac,
when you pass a parameter or use an accessor function (get() function) or something of that sort, it's actually just passing a pointer that points to the memory location of the Object you want, not actually passing the Object itself to you, nor is it instantiating a new instance of the Object for your use.if i pass Object itself instead of Student,which memory address it will point out?That question makes no sense. You pass what you pass. If it's a Student object, then the reference the method gets will point to that object, regardless of whether the method knows that it's a Student or just an Object generally.

Similar Messages

  • Passing object as parameter in JSF using h:commandLink tag

    Hi ,
    I have a scenario in which i need to pass objects from one jsp to another using h:commandLink. i read balusC article "Communication in JSF" and found a basic idea of achieving it. Thanks to BalusC for the wonderful article. But i am not fully clear on the concepts and the code is giving some error. The code i have is
    My JSP:
    This commandlink is inside a <h:column> tag of <h:dataTable>
    <h:commandLink id="ol3"action="ManageAccount" actionListener="#{admincontroller.action}" >
                   <f:param id="ag" name="account" value="#{admincontroller.account}" />
                   <h:outputText id="ot3" value="Manage Account" rendered="#{adminbean.productList!=null}" />
                   </h:commandLink>
    Also a binding in h:dataTable tag with the  binding="#{admincontroller.dataTable}"
                      My Backing Bean:
    public class CompanyAdminController {
              private HtmlDataTable dataTable;
              private Account account=new Account();
    public HtmlDataTable getDataTable() {
            return dataTable;
    public Account getAccount() {
             return this.account;
    public void setAccount(Account account) {
              this.account = account;
          public void action(){
                account= (Account)this.getDataTable().getRowData();
           } faces-config.xml
    <navigation-rule>
        <from-view-id>/compadmin.jsp</from-view-id>
        <navigation-case>
          <from-outcome>ManageAccount</from-outcome>
          <to-view-id>/manageAccount.jsp</to-view-id>
        </navigation-case>
      </navigation-rule>
    <managed-bean>
              <managed-bean-name>admincontroller</managed-bean-name>
              <managed-bean-class>com.forrester.AdminController</managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
              <managed-property>
                   <property-name>account</property-name>
                   <property-class>com.model.Account</property-class>
                   <value>#{param.account}</value>
             </managed-property>
         </managed-bean>My account object:
    public class Account {
    string name;
      public String getName()
        return this.name;
      public void setName(String name)
           this.name=name;
      }I need to display #{admincontroller.account.name} in my forwarded jsp. But I am not sure whether the code i wrote in commandlink is correct. I get an error if i use <f:setActionListener> . No tag "setPropertyActionListener" defined in tag library imported with prefix "f"
    Please advise.
    Edited by: twisai on Oct 18, 2009 11:46 AM
    Edited by: twisai on Oct 18, 2009 11:47 AM
    Edited by: twisai on Oct 18, 2009 11:48 AM

    Yes.. iam removed the managedproperty from faces-config. But still i get the null pointer exception on main jsp itself and i am taken to second jsp manageaccount.jsp. Did you find anything wrong in my navigation case in the action method??
                                     public String loadAccount(){
               Account account = (Account)this.getDataTable().getRowData();
                return "ManageAcct";And also can you please answer this question i have
    The AdminController is the backing bean of 1st JSP and manageAccontController is the backing bean of forwarded JSP .
    Can i put this action method and dataTable binding in a 2nd manageAccontController backing bean instead of AdminController. But if i do that way dataList binding in h:dataTable tag will be in first JSP backing bean and dataTable binding to 2nd JSP. Not sure how to deal with this.
    {                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Insertion will increase memory usage

    Hi,
    I notice that whenever my application does an insert, oracle DB will increase its consumption. As described in numerous posts in the forum, the memory is not released after the operation stops. However, when the application calls the connection.close() method, memory consumed earlier on will be reclaimed.
    I am wondering, if connection pooling is used (where connection is not disconnected but put back into the pool), the system will eventually run out of memory. Is this a correct assumption?
    The scenario is observed in a server with the following specs:
    Oracle DB: 9i Release 1
    OS: Windows 2000 SP 4
    Processor: 2 x Intel Xeon 1.8Ghz
    Ram: 1GB
    As i am not a DBA, i am not sure of the values in PGA, SGA etc. The application uses Oracle JDBC Type 4 driver (ojdbc14.jar) to do the insertion via a prepared statement.
    Please advice. Thanks.

    Any insight is greatly appreciated :)

  • High (and increasing) memory usage: Windows Driver Foundation

    Hello! I updated my Z50-70 to Windows 10 a few days ago, using the clean install method. Everything works great but I noticed one problem. There is one process "Windows Driver Foundation - user-mode driver framework" which consumes great amounts of RAM. But the worrying thing is that when I start the computer that process doesn't use too much memory, but it keeps increasing, slowly but surely, and it doesn't seem to stop. I have done some research and apparently it could be caused by some faulty driver. Does anybody have the same problem? Is it any way to identify what is causing this problem? Thanks.

    read this: https://msdn.microsoft.com/en-us/library/windows/hardware/ff550442(v=vs.85).aspx and this: https://msdn.microsoft.com/en-us/library/windows/hardware/ff557573(v=vs.85).aspx this will help you discover the driver with high usage or leakage.  

  • As soon as Firefox opens, it starts increasing memory usage until it maxes out, and it won't actually close unless I end the process in the task manager.

    Even if I'm not doing anything, no matter how few tabs I have open, Firefox will slowly increase in memory (RAM) usage until it's using nearly 100% of my computer's RAM, and everything basically freezes. Even when I close the window, the process continues to run, and I have to end the process in the task manager in order to get it to stop using RAM. I've tried disabling all my add-ons, and that does not help.

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Method design question...and passing object as parameter to webserice

    I am new to webservice...one design question
    i am writing a webservice to check whether a user is valid user or not. The users are categorized as Member, Admin and Professional. For each user type I have to hit different data source to verify.
    I can get this user type as parameter. What is the best approach to define the method?
    Having one single method �isValidUser � and all the client web service can always call this method and provide user type or should I define method for each type like isValidMember, isValidAdmin ?
    One more thing...in future the requirement may change for professional to have more required field in that case the parameter need to have more attribute. But on client side not much change if I have a single isValidUser method...all they have to do is pass additional values
    isValidUser(String username, String usertype, String[] userAttributes){
    if usertype == member
    call member code
    else if usertype = professional
    call professional code
    else if usertype = admin
    call admin code
    else
    throw error
    or
    isValidMember(String username, String[] userAttributes){
    call member code
    One last question, can the parameter be passed as object in web service like USER object.

    First of all, here is my code
    CREATE OR REPLACE
    TYPE USERCONTEXT AS OBJECT
    user_login varchar2,
    user_id integer,
    CONSTRUCTOR FUNCTION USERCONTEXT (
    P_LOGIN IN INTEGER
    P_ID_ID IN INTEGER
    ) RETURN SELF AS RESULT
    Either your type wont be compiled or this is not the real code..

  • Passing object as parameter

    Hi All,
    I have a procedure that takes IN an object as the parameter. I'm using SQL Developer , and also have SQL*plus.
    The type is
    create or replace
    TYPE TY_RAILROAD_OPERATOR AS OBJECT
    RRX_RAILROAD_OPERATOR_CD VARCHAR2(6 BYTE),
    RRX_RAILROAD_OPERATOR_NM VARCHAR2(60 BYTE) ,
    RRX_RAILROAD_OPERATOR_DSC VARCHAR2(2000 BYTE),
    STATUS CHAR(1 BYTE),
    LAST_UPDATE_DT DATE,
    LAST_UPDATE_USER VARCHAR2(60))
    procedure set_Railroad_Operator(p_TY_Railroad_Operator IN TY_Railroad_Operator, p_Railroad_Operator_Id OUT NUMBER) IS
    v_Railroad_Operator_Id NUMBER;
    BEGIN
    I have to execute the procedure. How should I pass the parameters?
    I would like to test the procedure, and I have no idea how to test it.
    Any help is appreciated.
    Thanks in advance
    N

    sample:
    SQL> CREATE OR REPLACE TYPE ty_railroad_operator AS OBJECT(
      2     rrx_railroad_operator_cd    VARCHAR2(6 BYTE),
      3     rrx_railroad_operator_nm    VARCHAR2(60 BYTE),
      4     rrx_railroad_operator_dsc   VARCHAR2(2000 BYTE),
      5     status                      CHAR(1 BYTE),
      6     last_update_dt              DATE,
      7     last_update_user            VARCHAR2(60)
      8  );
      9  /
    Type created.
    SQL> CREATE OR REPLACE PROCEDURE set_railroad_operator(
      2     p_ty_railroad_operator   IN       ty_railroad_operator,
      3     p_railroad_operator_id   OUT      NUMBER
      4  )
      5  IS
      6     v_railroad_operator_id   NUMBER := 10;
      7  BEGIN
      8     DBMS_OUTPUT.put_line(p_ty_railroad_operator.rrx_railroad_operator_cd);
      9     DBMS_OUTPUT.put_line(p_ty_railroad_operator.rrx_railroad_operator_nm);
    10     DBMS_OUTPUT.put_line(p_ty_railroad_operator.rrx_railroad_operator_dsc);
    11     DBMS_OUTPUT.put_line(p_ty_railroad_operator.status);
    12     DBMS_OUTPUT.put_line(p_ty_railroad_operator.last_update_dt);
    13     DBMS_OUTPUT.put_line(p_ty_railroad_operator.last_update_user);
    14  END;
    15  /
    Procedure created.
    SQL>
    SQL> DECLARE
      2     v_ty_railroad_operator   ty_railroad_operator
      3        := ty_railroad_operator('OP_CD', 'OP CODE NAME', 'OP CODE DESC', 'S',
      4                                SYSDATE, 'OP CODE USER');
      5     a                        NUMBER(10);
      6  BEGIN
      7     set_railroad_operator(p_ty_railroad_operator => v_ty_railroad_operator,
      8                           p_railroad_operator_id => a);
      9  END;
    10  /
    OP_CD
    OP CODE NAME
    OP CODE DESC
    S
    15-JUN-10
    OP CODE USER
    PL/SQL procedure successfully completed.
    SQL>

  • Exchange 2013 issue with High memory Usage on Mailbox server post SP1 update.

    So we have been chugging along fine since Feb 2 2014. 
    I performed a migration from 2010 from the UK to the US doing "incremental" mailbox moves. (get in contact with me if you want to know how. But we moved 400 Mailboxes averaging at 2gb a piece from the UK to the US, over the transcontinental link.
    & then the weekend of the final, had everyone & everything done by the end of the cutover weekend)
    Any woot.
    So I applied the 2013 SP1 a few weeks back, & have intermitantly been alerted to the memory spiking over 95%. For me (and for any exchange admin) when i get those types of alerts i drop everything & run to the nearest PC to see what is going on.
    Now the first & second time, it was an issue with logs filling up the drives, & my clean log script not running to remove any logs older than 30 days. But since then it has been legitimate 95%+ memory usage. 
    For the most part its been 95-97 max, with 1 or 2 times hitting 98. After some time, the memory does drop back down to 94.
    this is ....umm "fine" however it is becoming a nuisance, since most of the time it corrects itself. What i dont want to happen is get into the groove of saying "ah bah! its nothing" & letting it go.
    the server has 16gb of memory in it, it is the Mailbox server (CAS /Frontend is on a seperate server)
    below is a screen shot, so i know the Storeworker grabs whatever it feels like grabbing, however it does NOT EVER release memory.  I also see the NodeRunner.exe (2 of them)  is always around 900 almost a MB
    now if i could somehow get the first 2 Storeworkers to drop down to 900ish, then that should alleviate my memory issues. 
    what I am m looking for is some type of "magic bullet" to put my memory issues at ease..

    thats the problem & seems to be a misconception.
    Exchange NEVER releases the memory when other things need it.  As the users state in your thread you linked. (i came across that early in my search for a resolution). An example is if another admin & myself log into the backend server at the same
    time & begin clicking around opening things, etc..Memory will go to 100% which = No Buenos. 
    There are numerous post all over the internet from people who say it releases, but them 5 more comments to that 1 saying that it does not. 
    I know what the process's do, however it seems like the SP1 has increased memory usage, as typically the Store.exe would only grab about 900-1000. 
    in terms of the noderunner, once again i know its role, however we are now 2 months+ live on 2013 post migration, I do not think it is still indexing all those emails. 
    all DB's report healthy.
    Name                            Status  CopyQueue ReplayQueue LastInspectedLogTime   ContentIndex
      Length    Length                             State
    WBAC1\EXCHBE001                          Mounted         0         0                        
             Healthy
    WBAC2\EXCHBE001                          Mounted         0         0                        
             Healthy
    WBAC3\EXCHBE001                          Mounted         0         0                        
             Healthy
    WBAC4\EXCHBE001                          Mounted         0         0                        
             Healthy
    WBAC5\EXCHBE001                          Mounted         0         0                        
             Healthy

  • IPS shows Memory usage 80 % is that normal ?

    Hi there.
    I have a 2 5525x configured as active/standy and bot IPS modules configured with defaults there is no internet connection to them and no traffic passing thru , but IPS show memory usage 80% is that normal ?

    Could be, every environment is different when it comes to IPS. It all depends on what signatures you have configured and tuned.
    Sent from Cisco Technical Support Android App

  • SQL SERVER PHYSICAL MEMORY USAGE HIGH

    HI Teams,
    i am  going threw one of my production high physical memory usage in SQL Server. It always
    around 90%.When i reboot the server, it will initially good but end of the day it will around 95 to 98% physical memory usage.
    please give the valid solutions..,
    Regards,
    DBA 

    This is an expected/normal behaviour in SQL Server box. Memory management is highly dynamic in SQL Server and will use the complete memory allocated to SQL Server. It is also important to set the MAX SERVER MEMORY for the SQL Server instance. You may not
    need to worry about this unless you find any performance issues.
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped.
     [Blog]

  • Solaris 8 memory usage

    Is there a tool like McDougal's prtmem that will show accruate (or more accruate) memory usage then vmstat's freemem will show?

    tzzhc4 wrote:
    prtmem was part of the MEMTOOLS package you just listed, I belive it relies on a kernel module in that package and doesn't work on any of the newer kernel revisions.But it certainly works on 8, right? And that's the OS you were referring to, so I assumed you were thinking of something else.
    From that page:
    System Requirements:     SPARC/Solaris 2.6
                   SPARC/Solaris 7
                   SPARC/Solaris 8
                   SPARC/Solaris 9
                   x86 /Solaris 8
                   x86 /Solaris 9
    So if that's what you want to use, go for it!
    I thought freemem didn't include pages that had an identity, so there could be more memory free then was actually listed in freemem.What do you mean by 'identity'? Most pages are either allocated/reserved by a process (in use) or used by the disk cache. Under Solaris 7 and earlier, both reduced the 'freemem' number. Under 8 and later, only the first one does.
    Darren

  • Image loadClip memory usage problem

    I'm trying to create a gallery with built in slideshow. I
    load the images sequentially and then use the tween class to
    animate alpha values to shift between images. But when about 20-25
    images are loaded, the memory usage get too high and the animations
    start to lag.
    I know i can remove the images again, but that means i have
    to load them all over again when the slideshow starts over again.
    I know there must be a solution 'cause i've seen galleries
    which loads images without increasing memory usage, and the images
    is cached after loading.
    Hope you can help me.

    No. The basic principle is that you need to set the images to
    invisible. Only the two that are tweening can be visible. The
    problem you are experiencing occurs when you have more than 8 or 9
    images. Usually I put the first image at the bottom of the stack so
    that's why I said 'the one on top'.

  • How can I fix a drastic and sudden increase in memory usage?

    Before I start, I've already been having slight issues since the middle of last year, but I thought nothing of it. Firefox starting up using a good chunk of memory was normal, and I could run it alongside my other programs just fine. However, about 3 or 4 days ago, Firefox has started to spike in memory usage, to the point where it slows my entire computer down, will not load pages, and it's generally a mess. I always have to force close it, too, because whenever I close it conventionally, it's still open in the background. I've been having the background issue for a few months, but it's never been a large problem until the last few days. I had thought, at first, that it was the result of some programs that got installed as part of another installer. I had no issue with the installer, considering it came from a trusted forum for game design on an official topic, from a veteran member. However, it installed multiple toolbars and multiple programs. I went through all of them, uninstalled them, cleared my registry, everything was gone. However, this memory problem reared its ugly head, later. I uninstalled, reinstalled. Didn't work. I tried to reset firefox, but it stayed open in the background, and I could not reset it. I disabled my addons (ones I've been using for over a year, now), nothing. I tried to open Firefox with all addons disabled, but it stayed open in the background and refused to re-open properly. I'm actually on another browser right now because Firefox is no longer working for much of anything... I also put a couple of attachments up to show the increase in question. It starts at around 270,000 K (though the screenshot shows around 312,000), then after about 4 or 5 minutes on my homepage, shoots up to well over 1,000,000 and it basically stops functioning. If anyone has any additional steps they think I could take, I would appreciate it.

    '''[https://support.mozilla.org/en-US/kb/troubleshoot-firefox-issues-using-safe-mode Start Firefox in Safe Mode]''' {web link}
    While you are in safe mode;
    Type '''about:preferences#advanced'''<Enter> in the address bar.
    Under '''Advanced,''' Select '''General.'''
    Look for and turn off '''Use Hardware Acceleration'''.
    Poke around safe web sites. Are there any problems?
    '''[https://support.mozilla.org/en-US/kb/firefox-uses-too-much-memory-ram Firefox uses too much memory (RAM) - How to fix]'''
    This article describes how to make Firefox use less memory to make it run faster and prevent crashes.

  • Sql memory usage increase each time win app runs

    Hi,
    Sql memory usage increases each time when win app runs. Why does it work like this? Is it normal ?
    I restart SQL Server 2012. Only my win app uses SQL server.
    First run of winapp.
    start memory usage : 211.800 KB
    close memory usage: 528.136 KB
    Second run of xaf app.
    start memory usage : 528.136 KB
    close memory usage: 996.844 KB
    Third run of xaf app
    start memory usage : 996.844 KB
    close memory usage: 997.640 KB
    Fourth run of xaf app
    start memory usage : 997.640 KB
    close memory usage: 1.104.864 KB

    Hi,
    Sql memory usage increases each time when win app runs. Why does it work like this? Is it normal ?
    Yes, it is perfectly normal for SQL Server to acquire and hold onto large amounts of memory indefinitely.  This memory improves performance by avoiding disk I/O, query plan compilation and costly memory management. 
    On a dedicated SQL Server you should usually let SQL Server dynamically manage memory.  It will release memory if it detects memory pressure.  But if you often run other applications on the server than need significant amounts of memory (e.g. IIS,
    application services), you may want to set max server memory as suggested.
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • Ai CS4 & CS5: Can't move objects, huge memory usage. Tips?

    Okay guys this is my first post here, so bear with me.
    I'm just wondering if anyone can give guidance or refer me somewhere I can find a solution. I both CS4 and CS5 of Ai installed on my mac. Everything works just great, until I attempt to move an object. Something simple as a single line with freeze my system if I attempt to move it from one location to another.
    It is odd. I can scale/transform objects without any issue. Its just when I click an object to drag it to another location my system will freeze for about 5 seconds. The object won't move still. I opened up Activity Monitor and noticed my Memory usage sky rocketed as soon as I tried to move the object.
    Is there configurations for memory allocation in Illustrator like there is in photshop?
    (PS I have 3GB RAM and a 120GB HDD with 30GB free space, 2.0 Intel Core 2 processor, it's a 2007 Mac Mini)

    How big is the file? and is it complex if so then you simply do not have the resources. Also you might have a font cache issue.
    But I think the lack of resources.

Maybe you are looking for

  • Report output to be stored in app server

    Dear All, I would like to store the reports output in the app server folder. How do i achieve? I am using reports10g, app server 10g. I am using web.show_document to call the reports. I would like to the achieve the same using this web.show_document

  • What's best - Xserve, have  4 drives, mirror... stripe?

    Hi all A friend has ordered a new Xserve, which comes with an 80Gb drive. He's also ordered 3 x 500Gb drive modules. What is the best way to set-up the Xserve? My friend does design and makes up pages in Quark 6 with Photoshop .eps files linked. All

  • Import Aperture slideshow into iPad as SLIDES

    I prepared a slideshow using Aperture, individually introducing texts and modifying slide layout. 550 slides, this was a lot of work. Then I bought an iPad. From what I found until now, the only solution is Aperture > iPhoto > (movie) > iPad I don't

  • Allow users to leave longer voicemail

    I've got a user who gets especially long voicemail messages.  These vmail messages can be up to 3 minutes long.  It appears the default in my system (Exchange 2010 UM) is 1:45 seconds. That seems quite long to me.  But, I'm wondering if I can create

  • Database Version Compatibility

    What is the earliest version of the Oracle Database which is supported by Oracle 9ias. Regards Stephanie Farrugia.