Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3361322
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:08:19+00:00 2026-05-18T03:08:19+00:00

Dear all, I am using java rmi for my program, from client side i

  • 0

Dear all,
I am using java rmi for my program, from client side i am calling my interface method by passing single argument. Using this argument interface runs a query and returns 40,000 rows(each row containing 10 row)as a result.All these are stored in vector inside vector structure [[0,1,2,3,4,5,6,7,8,9],[],[],[],[],[]…]. This things happen when i am clicking one button. First time its works but again i am trying to do the same (ie clicking button ) It shows java.lang.out of memory exception at client side. pls help me.I am using Postgresql db.

Client side:
    Vector data = new Vector();
    data = Inter.getEndProductDetailsForCopyChain(endProductId);

Server side:
    public Vector getEndProductDetailsForCopyChain(int endProductId1)
    {
        Connection OPConnect  = StreamLineConnection.GetStreamline_Connection();
        Vector data=new Vector();       
        try{        
            System.out.println("Before query data vector size>>>>>>>>"+data.size());//mohan
            String sqlQry = "select distinct style_no,version_no,matNo,type,specs,color,size,ref_no,uom1 from garment where id=" +endProductId1;
            System.out.println("sqlQry"+ sqlQry);
            Statement st=OPConnect.createStatement();
            ResultSet rs = st.executeQuery(sqlQry);
            while(rs.next()){
                Vector row = new Vector();
                row.add(rs.getString("style_no"));
                row.add(rs.getString("version_no"));
                row.add(rs.getString("matNo"));
                row.add(rs.getString("type"));
                row.add(rs.getString("specs"));
                row.add(rs.getString("color"));
                row.add(rs.getString("size"));
                row.add(rs.getString("ref_no"));
                row.add(rs.getString("uom1"));
                row.add(new Boolean(false));
                data.add(row);
                }
            System.out.println("After query data vector size>>>>>>>>"+data.size());
        }catch(Exception e)
        {    e.printStackTrace();
             closeConnection(OPConnect);
        }
            return data;
       }

I cleared all the vectors and hashmap after finishing my process but still throwing Out of memory exception at client side this happens when data(query result vector) dispatched to client side.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T03:08:20+00:00Added an answer on May 18, 2026 at 3:08 am

    Try to re-use data, do not create a new vector on every request. data.clear(); // fill it then.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Dear all,Now i have this question in my java program,I think it should be
Dear all,I am now using a webtool http://fiddesktop.cs.northwestern.edu/mmp/scrape?url= to parse a webpage. For example,we
dear all..i've a textfield, it using barcode scanner for input data..after scan it shows
dear all, i'll take some data from the database. and join two tables.the code
Dear All, please help me since I'm newbie in SQL Server. I have a
Dear all, I now have a preliminary macro (defmacro key-if(test &key then else) `(cond
Dear all, I've been stuck with this problem now for a few days and
Dear all, I have a select query that currently produces the following results: DoctorName
Dear all, how do I get to peek at the source code for any
dear all,this is my code at xampp: $sql = INSERT INTO oqc_defect ; $sql.=

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.