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

  • Home
  • SEARCH
  • 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 8131953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:13:28+00:00 2026-06-06T09:13:28+00:00

FILE: I’m working with a refined csv version of a searchlog file which contains

  • 0

FILE:
I’m working with a refined csv version of a searchlog file which contains 3.3mio lines of data, with each line resembling a single query and containing various data about that query.
The entries in the file are sorted ascending by the session / userid.

GOAL:
Coupling entries that submitted the same queryterm while belonging to the same userid

APPROACH:
I’m reading the csv file line by line, saving the data in selfmade ‘Entry’-object and adding these objects to an arraylist. When this is done, I’ll sort the list by two criteria with a custom comparator

PROBLEM:

While reading the lines and adding the Entry-objects to the list (which takes very long) the program terminates with a OutOfMemoryException “Java heap”


So it seems that my approach is too hard on memory (and runtime).
Any ideas for a better approach?

  • 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-06-06T09:13:30+00:00Added an answer on June 6, 2026 at 9:13 am

    Your approach itself may be valid, and perhaps the simplest solution is to simply boost the memory available to the JVM.

    The JVM will only allocate itself a maximum amount of system memory, and you can increase this value via the -Xmx command line attribute. See here for more details.

    Obviously this solution doesn’t scale, and if (in the future) you want to read much bigger files, then you’ll likely need a better solution to reading these files.

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

Sidebar

Related Questions

File /usr/lib/python3.1/codecs.py, line 300, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf8'
file.each_line do |line| #skip the first one/not a user 3.times { next } if
file.txt contains: ##w## ##wew## using mac 10.6, bash shell, the command: cat file.txt |
File C:\Users\Tom\Desktop\Tetris!\tetris.py, line 206, in typeSet Globals.blockArray[i].x.append(7) IndexError: list index out of range I
File F:\ake\pa\th\help.py, line 268, in main print type(outputs[x]) KeyError: '0' My file is quite
file location is: yiiroot/framework/widjets/assets/gridview/jquery.yiigridview.js I need to change one line in this file so
File /usr/local/lib/python2.5/site-packages/libxml2.py, line 1, in <module> import libxml2mod ImportError: /usr/local/lib/python2.5/site-packages/libxml2mod.so: undefined symbol:xmlTextReaderSetup >>> import
File /srv/xxxx/venv/lib/python2.6/site-packages/django/core/files/storage.py, line 193, in delete os.remove(name) OSError: [Errno 13] Permission denied: '/srv/notxxxelinq/app/xxx/site_media/xx/xxx/20101217T194905.document.pdf' I've
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
FILE *ExcelFile = fopen(testdata.csv,w); if (ExcelFile == NULL) return -1; fprintf(ExcelFile,1 2 3); fprintf(ExcelFile,\n);

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.