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 7893317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:06:08+00:00 2026-06-03T07:06:08+00:00

I have written a web crawler in Java, and I am using Berkeley DB

  • 0

I have written a web crawler in Java, and I am using Berkeley DB to save the pages I crawl (for later indexing, etc.). I am storing each page as a Webpage object, which has the following instance fields:

@PrimaryKey
String url;
String docString;
Date lastVisited;
Date lastChecked;
ArrayList<String> stringLinks;

The largest field is the String docString, which is the entire HTML content (normally not more than 500KB even on a huge page) and stringLinks keeps a String for each of the outbound links on the page. That shouldn’t be too large, at most it’s 100 strings of length ~70 (not even a few KB).

I crawl a little faster than a page per second, sometimes 2 pages per second, and I am seeing the Berkeley Database grow to about 2-3MB per page, which is absolutely crazy given the data stored. The database stores the Webpages in an EntityStore, and I sync it periodically. No matter what I change, I can’t get the disk usage to go down!

This is a pretty big problem, because if I run multiple instances of the crawler (I have built it to be distributed) they will each quickly use a ton of disk space. If this is increasing linearly, I might be fine, but there is no way to tell by what function this space is ballooning. All i know its that it is many times the space of the actual data.

Is there something I am missing about EntityStore?

One thing to note is that I am both reading and writing from the DB, so I can’t set any flags to make it write only or something. And I would prefer not to increase the cache size much since this is a heap space sensitive environment.

  • 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-03T07:06:10+00:00Added an answer on June 3, 2026 at 7:06 am

    The issue was with deferred write. I had to enable deferred write and then call env.sync() on a timer in order to keep the DB in check rather than call env.sync() on each put. The size decreased by a factor of more than 30…

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

Sidebar

Related Questions

I have written myself a web crawler using simplehtmldom, and have got the crawl
I have written code in Java to access web cam,and to save image... I
I have web application written in java using Eclipse. It has just one servlet
I have written REST web service in netbean IDE using jersey framework and java.
I have written a Web Service in Java using axis2 and the POJO deployment
I have a web-application written in java. I would like to run integration tests
I have an asp.net web application written in C# using a SQL Server 2008
I have written a web scraping program to go to a list of pages
I have written a facelets web application using tomcat as a application server. My
I have written a test method for a web service in VS2008, using visual

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.