DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report

Ehcache Size Configuration

Aurelien Broszniowski user avatar by
Aurelien Broszniowski
·
May. 28, 12 · Interview
Like (0)
Save
Tweet
Share
24.02K Views

Join the DZone community and get the full member experience.

Join For Free

Since Ehcache 2.5, you’ve got Automatic Resource Control (ARC), which help you to easily tune your cache.

When you think that software is constantly changing, let’s say you have a class that takes 1Kb when instantiated, then you put 1000000 elements in a cache, it takes 1Gb. After a few releases, the class has been modified, it has more fields, and it takes now 2Kb when instantiated, the exact same cache definition will take 2Gb…

ARC helps you to define a cache by memory size. In this example you say you want your cache to use 1Gb of heap memory, it will first hold 1M elements, then 500000… Your tuning is automatically handled…

In case you want to have a look at ARC vs count-based config, here is a summary of options you can use:

Standalone – Cache Configuration

  Count-based Count-based – legacy pre-2.5 Size-based (ARC)
Heap maxEntriesLocalHeap maxElementsInMemory (deprecated) maxBytesLocalHeap
Off heap maxMemoryOffHeap maxMemoryOffHeap maxBytesLocalOffHeap
Disk maxEntriesLocalDisk maxElementsOnDisk maxBytesLocalDisk

Clustered – Cache Configuration

  Count-based Count-based – legacy pre-2.5 Size-based (ARC)
Heap maxEntriesLocalHeap maxElementsInMemory (deprecated) maxBytesLocalHeap
Off heap maxMemoryOffHeap maxMemoryOffHeap maxBytesLocalOffHeap
Disk NA maxElementsOnDisk NA

more info on Ehcache ARC

Ehcache

Published at DZone with permission of Aurelien Broszniowski, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • NoSQL vs SQL: What, Where, and How
  • Java REST API Frameworks
  • 5 Software Developer Competencies: How To Recognize a Good Programmer
  • Use AWS Controllers for Kubernetes To Deploy a Serverless Data Processing Solution With SQS, Lambda, and DynamoDB

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: