out of memory error

From: Oliver Layug (oliverlayu..ahoo.com)
Date: Sat Oct 16 2004 - 12:18:14 EDT

  • Next message: Oliver Layug: "RE: out of memory error"

    Good morning!

    Hi! I'm having problems with this code. I have a large
    consumer table with references to several small lookup
    tables. This code is inside a java bean which is
    called by a jsp. My problem is that when i run this,
    the java process eats up a lot of memory. Im assuming
    that the memory is being used for compilation. But how
    come as the consumer table gets bigger, the memory
    java eats up becomes bigger? Im only inserting 1 entry
    in the consumer table. The consumer table contains
    around 24000 entries and the lookup tables contain
    only 2 to 6 entries. I'm running this on tomcat4 under
    netbeans3.6 on a windows 2003 and mysql4 db.

    Thanks,
    Oliver

    //Problem Code

                    Consumer c =
    (Consumer)context.createAndRegisterNewObject("Consumer");
       
                    c.setAccountNo(this.accountNumber);
                    c.setAddress(this.address);
                    c.setAmps(this.amps);
                    c.setBirthday(bdate.getTime());
                    ...
                    
                    c.setMembershipDate(mdate.getTime());
                 
    c.setMembershipNo(this.membershipNumber);
                    c.setMeterSerialNo(this.meterId);
                    c.setMiddleName(this.middleName);
                    c.setMultiplier(new
    Double(getMultiplierDouble()));
                    Date datestamp = new Date();
                    c.setDateTimeStamp(datestamp);
                    
                    //Code of Consumer.getMembershipType() is shown
    below
                    Refconsumerpaymenttype cpt =
    Consumer.getConsumerpaymenttype(context,getConsumerpaymenttypeidInt());
                    Refconsumerstatus cs =
    Consumer.getConsumerStatus(context, getStatusidInt());
                    Refconsumertype ct =
    Consumer.getConsumerType(context,
    getConsumertypeidInt());
                    Refmembershiptype mt =
    Consumer.getMembershipType(context,
    getMembershiptypeidInt());
                    Route route =
    Consumer.getRoute(context,getRouteIdInt());
                 
                    c.setToRefconsumerpaymenttype(cpt);
                    c.setToRefconsumerstatus(cs);
                    c.setToRefconsumertype(ct);
                    c.setToRefmembershiptype(mt);
                    c.setToRoute(route);
                    context.commitChanges(Level.WARN);

    //
        
        public static synchronized Refmembershiptype
    getMembershipType(DataContext context, int id){
            ObjectId i = new
    ObjectId(Refmembershiptype.class,
    Refmembershiptype.MEMBERSHIP_TYPE_ID_PK_COLUMN,id);
            SelectQuery query =
    QueryUtils.selectObjectForId(i);
            query.setLoggingLevel(Level.WARN);
            List l = context.performQuery(query);
            Refmembershiptype mt = null;
            if(l.size()!=0){
                mt = (Refmembershiptype)l.get(0);
            }
            return mt;
        }

                    
    _______________________________
    Do you Yahoo!?
    Declare Yourself - Register online to vote today!
    http://vote.yahoo.com



    This archive was generated by hypermail 2.0.0 : Sat Oct 16 2004 - 12:18:15 EDT