Want to know the size of Session Object

Hi,
There are around 100 objects stored in my application session.i want to know the size of Session object.
For this i perform the following code:
Enumeration enu=request.getSession().getAttributeNames();
int i=0;
               Object obj=null;
               while(enu.hasMoreElements())
String obj_name=(String)enu.nextElement();
                    long MemoryBefore=Runtime.getRuntime().freeMemory();
                    obj=new Object();
                    obj=(request.getSession().getAttribute(obj_name));
                    long MemoryAfter=Runtime.getRuntime().freeMemory();
                    obj.getClass().getName();
                    obj=null;
     System.out.prinltn(Session Attr Variable ::: "+obj_name +" and Size :"+(MemoryAfter-MemoryBefore));
                         i++;
But each time i get size 0

Anurag_Tripathi wrote:
Hi,
There are around 100 objects stored in my application session.i want to know the size of Session object.
For this i perform the following code:First, that code makes no sense. Second, I highly recommend using a [Java profiler|http://www.google.com/search?q=java+profiler] to measure your application's performance. It will be much easier than trying to cobble together code to do this on your own.
~

Similar Messages

  • I want to know the size of of database

    hi, iam using HP-UX with oracle10G so that, i want to know the size of of database in my system, for that i can use the follwing queries is this is correct or not?
    1. select sum(bytes) as total_size from dba_data_files;
    ANS is:
    TOTAL_SIZE
    29718740992
    2.select sum(bytes) as free_size from dba_free_space;
    ANS is:
    FREE_SIZE
    6940393472
    3. select sum(bytes) as used_size from dba_segments;
    ANS is:
    USED_SIZE
    25215827968
    i GOT like this iam not getting is this TOTAL size is 28 GB?????????????
    4.select * from DBA_FREE_SPACE_COALESCED;
    ANS for this ????????????????
    please help me anyone......

    i want to know the size of of database in my systemDefine "size":
    - The total size of the dbf files?
    - The total data space used?
    - The total tablespace size?
    For example, this show the size of a single table, in meg:
    select
    segment_name table_name,
    sum(bytes)/(1024*1024) table_size_meg
    from
    user_extents
    where
    segment_type='TABLE'
    and
    segment_name = 'MYTAB' ;
    Mike Ault has a script collection that measures all possible ways to measure database size:
    http://www.oracle-script.com
    Hope this helps. . .
    Don Burleson
    Oracle Press author
    Author of “Oracle Tuning: The Definitive Reference”
    http://www.dba-oracle.com/bp/s_oracle_tuning_book.htm

  • I want to know the size of my drive.

    I want to know the size of my drive or folder like I used to at the bottom of the window. But since installing Lion that's vanished ?? Elp...
    It used to be indicated at the bottom of my windows, size, amount of files etc. How do I switch this back on ?
    I can't see it, elp me
    Isabella

    Tony, you are a genius who doesn't waste time on words, just deeds.......... Top marks from me !

  • How to know the size of data in some columns of a table?

    Hi,
    How can the size of of data for some specified column be determined?
    For example : TableA has 20 columns and the size of table is 20 GB. I want to know the size of data kept in last four columns.
    Thanks in Advance,
    Vishu

    You could use vsize to determine the size of a column element and sum them upselect sum(vsize(column_of_interest)) from whatever_table;

  • How to get to know the size of the biggest file in ContentServer

    Dear colleagues!
    Does anybody knows how to get to know the size of the biggest file in the ContentServer?
    Vladimir
    Edited by: Vladimir Pavlovsky on Mar 2, 2010 11:11 AM

    Vladimir Pavlovsky wrote:>
    > Dear colleagues!
    > Does anybody knows how to get to know the size of the biggest file in the ContentServer?
    Hi Vladimir,
    I assume you want to know the size of the biggest file stored in the content server don't you?
    This information is available through the content server API layer only - so better open this question in the knowlegde management forum.
    regards,
    Lars

  • How do we know the size from the our objects in transport request no?

    Dear All,
    I have the need to know the size from the objects that we're gonna transport where those objects are attached in transport request no.
    Is that the way to know it ?
    If yes, could you kindly let me know regarding it ?
    Thanks a lot,
    Best regards,
    Daniel N.

    Hi Niel,
    If you want size and information of co files and data files, then the manual procedure is like this.
    1. Using transaction code AL11 (to see files on server)
    2. Goto folder DIR_TRFILES  ( or  /usr/sap/trans)
    3. Double click on that row.
    4. Inside that you will find two folders (among other folders)
        cofiles, data
    5. Goinside the subfolder you are interested. Eg. cofile
    6. Now suppose you request number is ABCK900168
       where ABC will be your system number, then the file name will be
       K900168.ABC
      or you can search for K900168
    7. The data file will have the name (in data folder)
        R900168
    There you can see the size (length column name) of the file.
    Hope this helps.
    regards,
    amit m.

  • How to know the size of a webservice request

    Hello...
    I'd like to know if you know how do I get the size of a Web request? I mean, I need to know the size of a Web Request 'cause I'll fill a Gauge Object up based on the quantity that I have received from the WebService.
    I'm using the KSOAP and KXML API's for consuming that WebServices and I used the Content-lengh Method and it didnt return anything to me... it returned empty. So, do you know how do I fill a Gauge Object based on the size of the WebRequest? Could you tell me some examples plz?
    Thanx...
    Lucas Abrao

    How to know the size of a DB ?If you want to know the physical size, query dba_data_files + dba_temp_files. if you need to know the actual consumed space in those files, compute sum of bytes from DBA_SEGMENTS.
    How to know the size of a TABLE ?Query all/dba/user_segments.
    How to get the content of a procedure/view/trigger ?all/dba/user_source, all/dba/user_views, all/dba/user_triggers.
    Message was edited by:
    Satish Kandi

  • You want to know the amount of space the transaction log for the Customer database is using. Which T-SQL command would you use?

    You want to know the amount of space the transaction log for the Customer database is using. Which T-SQL command would you use?

    Forced me to do a little research.
    DBCC SQLPERF(logspace)
    See also
    http://stackoverflow.com/questions/198343/how-can-i-get-the-size-of-the-transaction-log-in-sql-2005-programmatically
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • How to know the size of a DATABASE ?

    Guys,
    How to know the size of a DB ?
    Also
    How to know the size of a TABLE ?
    How to get the content of a procedure/view/trigger ?
    Inputs are welcome !

    How to know the size of a DB ?If you want to know the physical size, query dba_data_files + dba_temp_files. if you need to know the actual consumed space in those files, compute sum of bytes from DBA_SEGMENTS.
    How to know the size of a TABLE ?Query all/dba/user_segments.
    How to get the content of a procedure/view/trigger ?all/dba/user_source, all/dba/user_views, all/dba/user_triggers.
    Message was edited by:
    Satish Kandi

  • How to know the size in byte of a file before importing it with ftp

    hello
    i have a file in witch there is the pathe of many file
    i reade these path and i use ftp to get these file
    my problem is that i want to display a progress bar during the getting of file
    so dont no how i can know the size of these file to put a maximum to the progress bar

    package cni;
    import javax.swing.*;
    import sun.net.ftp.*;
    import sun.net.ftp.FtpClient.*;
    import java.io.*;
    import java.lang.*;
    import sun.net.TelnetInputStream;
    import java.util.*;
    import java.lang.String;
    public class FTPclients
    //Variables
    private static String server = "faycal";
    private static int port = 21;
    private static String user = "anonymous";
    private static String passwd = "[email protected]";
    public String toString(JTextField tx)
    String txt;
    txt= new String(tx.getText());
    return txt;
    public static void main(String args[])
    ConnFile cf = new ConnFile("d:\\cni\\adresse.txt");
    FTPclients fc = new FTPclients();
    ConnFile cfbis = new ConnFile("d:\\cni\\chemin.txt");
    try
    //String s=cf.lectureid();
    String s;
    while((s=cf.br.readLine())!=null)
    String s1=s.substring(0,s.lastIndexOf("\\"));
    String s2=s.substring(s.lastIndexOf("\\")+1);
    System.out.println(s1);
    System.out.println(s2);
    //ajout du double anti slash a la chaine s1
    String name =s1;
    StringBuffer sb = new StringBuffer(s1.length()+10);
    for(int index=0; index<s1.length();index++)
    char c = s1.charAt(index);
    sb.append(c);
    if(c=='\\')
    sb.append('\\');
    System.out.println(s1);
    s1= sb.toString();
    System.out.println(s1);
    //creation d un client ftp
    FtpClient client = new FtpClient();
    System.out.println("gggggggggggggalut");
    client.openServer(server,port);
    System.out.println("xxxxxxxxxxxxalut");
    client.login(user, passwd);
    client.binary();
    client.cd(s1);
    System.out.println("la taille de "+s1+" est "+taille+" octets");
    System.out.println("ssssssssssssalut");
    System.out.println(client.welcomeMsg);
    System.out.println("buhhhhhhhhhhhhh");
    //copie du chemin saisi par l utilisateur
    String chemre;
    cfbis = new ConnFile("d:\\cni\\chemin.txt");
    String chemvir = cfbis.lectureid();
    System.out.println(chemvir);
    if (chemvir==null)
    chemre="d:\\";
    System.out.println(chemre);
    else
    chemre=chemvir;
    System.out.println(chemre);
    String chem=chemre+"\\"+s2;
    System.out.println(chem);
    //pour creer le nouveau fichier
    TelnetInputStream fich = client.get(s2);
    FileOutputStream out = new FileOutputStream(chem);
    //pour ecrire dans le nouveau fichier
    int i;
    while(true)
    i = fich.read();
    if(i == -1)
    { break; }
    out.write((byte)i);
    System.out.println("bahhhhhhhhhhhh");
    //fermeture du serveur ftp
    client.closeServer();
    System.out.println("ok");
    }//fin while
    String chemvir = cfbis.lectureid();
    }//fin du try
    catch(IOException e)
    System.out.println(e);
    }//fin du main
    }// fin de la classe
    do you know how

  • How to know the size in bytes of a directory?

    I would like to know if there's a class or a function which allows to know the size of all files in a directory?

    You have to create a File object for your directory, then list all files (using the list() method) and create a File object for each item returned. Then ask each File object for it's size and add them up.
    Thomas

  • Determine the Size of an Object in ObjectInputStream

    Hi all,
    I have a quick question. I have a class that is being written over a socket using ObjectOutputStream and ObjectInputStream. I want to be able to set the buffer size of the socket to fit only ONE object. Can anybody tell me how to determine the size of that object?
    (Note, the object has a Properties object within it, but for the time being, it can be assumed that properties object will always be the same.)
    - Adam

    Having written it to the outputStream, thought, can
    the size be determined somehow by the inputStream?No, it can't
    This is related to my previous question (on Pushlets
    and Thread Priorities). I didn't read that one.
    I believe that it's possible
    that multiple threads are trying to write to the
    socket at the same time, and I cannot synchorize the
    input stream to get a lock on it. Do you mean the outputstream? Why can't you synchronize the method that writes to the outputstream?
    I thought this
    might be causing the data to not be sent over the
    socket until all the threads have finished. That doesn't sound correct. But you could call the flush method when an object is written.
    I
    figured if I reduced the size of the socket buffer,
    it would only accept a single object, eliminating
    this problem?I don't think so.
    /Kaj

  • How can i know the size of ResultSet???

    i run a statment
    ResultSet rs = cs.executeQuery();
    rs.next();
    rs.getString(i) ; <-------------------- how can i know what is the max i can i get???????
    i didn't find function that returns the size of it !!!!!!!!!!
    any one can help me

    u want to know the number of rows returned or size of columns?

  • How to know the size of a table by using sql command?

    i've got a question that i hope to know a table size by using sqlcommand?
    what to do?
    thanks in advice,

    Select sum(bytes) bytes, sum(blocks) blocks
    from dba_segments
    where segment_name = 'YOUR_TABLE';This will give you the space in the database allocated to the table. If you want to know the actual space it takes up then you'll have to analyze the table and interrogate the stats using DBA_TABLES.
    APC

  • I want to know the versions in SCM and the latest versions

    Hi everyone
    I want to know the difference between last 2  SCM version. Actually i am an abaper and doent know much about scm , I am want to know about it . Please help .
    Thanks
    Bharathi.

    Hi,
    See this links,
    http://www.scmexpertonline.com/archive_index.cfm?session=&volume=Volume_03_(2005)
    http://www-03.ibm.com/systems/storage/solutions/sap/pdf/hot_standby.pdf
    Regards,
    Jagadish

Maybe you are looking for