krummas / DrizzleJDBC

A BSD licensed JDBC driver for Drizzle and MySQL
BSD 3-Clause "New" or "Revised" License
31 stars 22 forks source link

Prepared statements cache can lead to memory exhaustion #38

Open StephG38 opened 9 years ago

StephG38 commented 9 years ago

When using a long running connection using a lot of different prepared statements (eventually, these prepared statements being big statements), these prepared statements get cached.

This can lead to OOM errors, as this cache is unbounded.

This can be solved by 2 or 3 different ways :

  1. provide an option to disable the cache completely. This will avoid such OOM conditions.
  2. cache only statements within some size threshold
  3. use a better cache implementation (LRU for example)
krummas commented 9 years ago

could you convert the tabs to spaces?

other than that, lgtm

StephG38 commented 9 years ago

Hi Marcus,

Sorry about these tabs. I am using eclipse and did not see it inserted tabs instead of spaces. I just pushed 2 files that had these tabs. Not sure if I need to post a new pull request though

Cheers

Stephane


Stephane Giron Sr MTS sgiron@vmware.com mailto:llauner@vmware.com 29, Boulevard des Alpes, 38240 Meylan, France +33 6 89 51 43 69

[VMware]http://www.vmware.com/

http://www.vmware.com/

On 06 Oct 2015, at 08:38, Marcus Eriksson notifications@github.com<mailto:notifications@github.com> wrote:

could you convert the tabs to spaces?

other than that, lgtm

— Reply to this email directly or view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_krummas_DrizzleJDBC_issues_38-23issuecomment-2D145754437&d=BQMCaQ&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=JapcDH4703y1U1Jzbo_CQ4YjRlom6tww0q96ZCaKxVA&m=T54B3WVCkcjQNKspt1Y8yn-qAwjw-TshStzwhdfbTQ8&s=1m5R11yEmpY69VPbPOyfqDs8UnUDxJJFEgPwEbraVqA&e=.