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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:52:48+00:00 2026-05-17T18:52:48+00:00

How to set L1 or L2 cache size-limitation. I concern of increasing the cache-size.

  • 0

How to set L1 or L2 cache size-limitation. I concern of increasing the cache-size.
One way is defining timeout for cache but i want to know is it possible to make a constraint for cache size or not?

RGDS
Navid

  • 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-17T18:52:48+00:00Added an answer on May 17, 2026 at 6:52 pm

    How to set L1 cache size-limitation

    You can’t. The only option is to clear the persistence context manually at regular intervals if you want to “control” (actually, clear is very aggressive, it removes all entities) its size.

    How to set L2 cache size-limitation

    This depends on the underlying cache provider. In other words, this is done by configuring the L2 cache implementation. For example, EHCache has a maxElementInMemory parameter.


    what happens in L1?! how much entities will be in the memory as time pass? w/o any constrains ?!

    As much as you put in it, until an eventual OutOfMemoryError, hence the need to clear explicitly:

    • on large batch jobs (even if they occur in a single transaction)
    • if a long-lived EntityManager is used

    But the usual pattern is to use a short-lived EntityManager and most use cases are not batch jobs so this is not a concern.

    See also

    • JPA wiki book
      • 2.5 Clear
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to get the size of the result-set when doing a query?
I don't know if this problem is specific to my set up but when
I have set cache headers to be far in future (1 year from now)
UserControl: How to set Output Cache duration programmatically?
I am trying to set up a cache, however the method I am using
Let's say I cache my CSS file and set their expiry date to a
I would like to set a setting (nglayout.debug.disable_xul_cache) to true. But when i enter
Currently my application caches models in memcache like this: memcache.set(somekey, aModel) But Nicks' post
cache.set(key, Biglist, 3600) print cache.get(key) When my Biglist is a huge list of lots
What's an appropriate way of measure a PHP objects actual size in bytes/kilobytes? Reason

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.