Closed Bug 616019 Opened 15 years ago Closed 15 years ago

10mb places.sqlite database due to aggressive file growth.

Categories

(Core Graveyard :: History: Global, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(fennec2.0b4+)

RESOLVED FIXED
Tracking Status
fennec 2.0b4+ ---

People

(Reporter: dougt, Assigned: dougt)

References

Details

Attachments

(3 files)

On desktop, we worry alot about fragmention. On mobile, we care a bit more about footprint. Our sqlite files tend to frag a bunch on desktop, so we aggresively bump their side. For example, the places file grows in increments of 10mbs. http://mxr.mozilla.org/mozilla-central/search?string=SetGrowthIncrement On mobile, I am not sure that this value is correct. For a very small profile, I already have a 10mb file I need to read in (or parts of it). If I compare with and without the call to SetGrowthIncrement: 1) clean profile 2) launch go to people.mozilla.org/~dougt 3) exit 4) launch 5) record data with call: places.sqlite file size: 10mb total memory used: 84mb res without call: places.sqlite file size: 992k total memory used: 83mb res I am not sure what the ideal value for SetGrowthIncrement, but I think on mobile we can do better assuming that there isn't much of a startup cost. Taras, do you have any input on changing these values for mobile?
yeah, that isn't the best way to fix that. what about meego, maemo, iphone, palm, desktop, blah. would anyone mind if we added prefs for this or a new configure options similar to MOZ_GFX_OPTIMIZE_MOBILE but for non-gfx code?
(In reply to comment #2) > would anyone mind if we added prefs for this or a new configure options similar > to MOZ_GFX_OPTIMIZE_MOBILE but for non-gfx code? Prefs can be difficult; we'd have to be careful when we lookup the value since database connections can be opened off of the main thread.
I think a pref would be best.
Attached patch patch v.1Splinter Review
i'll patch mobile-browser separately.
Assignee: nobody → doug.turner
Attachment #494757 - Flags: review?(sdwilsh)
tracking-fennec: --- → ?
tracking-fennec: ? → 2.0b4+
did you consider a numeric pref, say, in case I'd prefer a 1MB increment?
...the wording then being something like, toolkit.storage.maxGrowthIncrement, to cap the callers' suggestions
something like so
Attachment #495011 - Flags: feedback?(doug.turner)
Comment on attachment 495011 [details] [diff] [review] dueling patches (central) i think 10 was chosen to avoid fragmentation. not sure of the value of having that value dynamic. But, either approach will work for me. Taras?
(In reply to comment #9) > Comment on attachment 495011 [details] [diff] [review] > dueling patches (central) > > i think 10 was chosen to avoid fragmentation. not sure of the value of having > that value dynamic. But, either approach will work for me. Taras? I like the dynamic approach, 1mb will still reduce fragmentation. 10 was chosen based on firefox places io pattern. My only concern is that for best perf this number should be tweaked for each individual db, but short of adding a pref for every growth-increment user, i think this is a good tradeoff.
Comment on attachment 495011 [details] [diff] [review] dueling patches (central) PR_INT32_MAX shouldn't be the default fallback. :)
Attachment #495011 - Flags: review?(sdwilsh)
Attachment #495011 - Flags: feedback?(doug.turner)
Attachment #495011 - Flags: feedback+
Both of these patches suffer from the same threadsafety issues. This should be built on top of the work in bug 580790.
Depends on: 580790
lets add an #ifdef in the short term so that maemo doesn't get killed by this bug.
How are we changing the ifdef exactly?
Attachment #495122 - Flags: review?(sdwilsh)
Comment on attachment 495122 [details] [diff] [review] work around until we fix the other bugs. r=sdwilsh
Attachment #495122 - Flags: review?(sdwilsh) → review+
Attachment #494757 - Flags: review?(sdwilsh) → review-
Comment on attachment 495011 [details] [diff] [review] dueling patches (central) Per comment 12
Attachment #495011 - Flags: review?(sdwilsh) → review-
http://hg.mozilla.org/mozilla-central/rev/1ad47fdb9195 if someone cares, they can file a new bug about making this a preference. or maybe we will the next time we bring up a new platform.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: