I'd like to suggest everybody who wants to better understand the DBCache
issues and its crashes,
 
to read the following thread I've found on Treo Central.
 
http://discussion.treocentral.com/showthread.php?p=846147
<http://discussion.treocentral.com/showthread.php?p=846147&posted=1#post8461
47> &posted=1#post846147
 
Bellow is a post from an user (
<http://discussion.treocentral.com/member.php?u=24049> tomvb2000 ) who did
describe the whole thing very well:
_____________
 
 Ok, the most recent posts made me dig up an old post and add a bunch of
related information to it to fully answer dgelfuso's questions. Please
review and let me know what you think. Once it's been reviewed, I'll submit
it to T|C's FAQ list and post on the MTDN Knowledge Base.

Here goes:

FAQ: Solving "out of (cache) memory" issues on the Treo 650.

What is the problem?

If you often get a "There is not enough memory available..." message
(typically when you start Blazer) despite having a couple of MB of free
memory, you are likely running into the hidden, secondary memory limit of
the Treo650 - the NVFS (Non-Volatile File System) dbCache memory limit. Not
everyone will run into this problem - it really depends on which apps you
run and how much total memory they use. Note that this is similar to, but
not the same as the Blazer internal web page cache. First, some background
information.

The Treo650 was one of the first Palm devices to use an NVFS memory system
(also used on the LifeDrive and Tungsten E2 and T5). The good thing is that
it prevents data loss when you run out of battery power. However, there are
some new things to deal with in the current implementation in PalmOS 5.4
(Garnet). For a good overview of the NVS implementation, read this article
<http://mytreo.net/archives/2005/07/living_with_nvs_on_your_treo_650.php>
first.

>From http://www.resco.net/palm/backup/aboutbackup.asp 


Quote:
What is NVFS?
Non-Volatile File Storage, i.e. a permanent storage that will survive even
the battery removal. 

Unlike older Palm handhelds, databases are located in the NVFS storage and
cannot be accessed directly. Instead, they are accessed through a reserved
RAM area called DbCache. 

It is a kind of window into NVFS: Prior to use the DB must be copied to the
DbCache and after the use the changes are copied back to NVFS and the DB may
be removed from the DbCache to provide the space for other databases. For
efficiency reasons the last step is delayed until the DbCache is full. 

DbCache is around 10 MB and you can have installed a lot more data in the
RAM. You can even have a single database that is larger than the whole
DbCache. This implies a fundamental consequence for the Palm programming:
The position of the database or their records is no longer constant.    


The dbCache memory can be thought of as a "staging" area between fast
dynamic RAM and slower NVFS/flash memory. The PalmOS cache manager is
supposed to manage this fixed amount of memory so that updated data gets
written back to flash while yet allowing new data to come in (when a new app
is launched or database is opened) without the cache getting full again.
Unfortunately, the PalmOS cache manager doesn't seem to be effective enough
in some situations resulting in these "There is not enough memory
available..." messages.

What can I do about it?

There are five main options to workaround this problem.

1. Make sure you are running the latest revision of the firmware. PalmOne
has made some efficiency improvements in how it allocates memory which
results in more free memory (biggest benefit is for PIM data). Palm OS
updates may be checked here <http://www.palmone.com/us/support/downloads/> .

2. Move applications to an SD card and launch them from there. You can use
the Palm built-in launcher or a 3rd party app like zLauncher, Initiate,
PowerRun or LauncherX to do this. The result is that while launching apps
will be slightly slower, you will have more free memory since the launched
app no longer takes up memory when it's not running. Note that some apps
must remain in onboard memory such as those that sync to your PC/Mac or
those while are always running in the background (e.g. Butler, TreoGuard,
ProfileCare, etc) and generate alarms or respond to certain events (time of
day, ringtone/call managers, etc).

3. Ensure you are running apps that were specifically designed to run on
NVFS systems such as the Treo650. Given that databases may be moved around
when PalmOS is managing the dbCache area, some apps need to be updated to be
compatible. While this may not help your "out of memory" problems, it will
definitely help prevent other crashes. 

4. If you can go most or all of the day before getting an "out of memory"
message, the simplest approach might be to do a nightly soft reset (you may
already do this in prep for nightly backups). The advantage is that a soft
reset will automatically clear the db cache and allow you to start fresh
where the db cache amount is very close to the amount of total free memory
available. You can use apps like ProfileCare, mReset+LookAtMe, and others to
schedule a nightly soft reset. 

5. Use dbCacheTool and Resco Locker.

What is dbCacheTool and how do I use it?

DBCacheTool is an app which clears the cache in order to make more room to
load new data. Essentially, it does what the PalmOS built-in cache manager
doesn't do well on it's own. You can find dbCacheTool here
<http://www.jade.dti.ne.jp/%7Eimazeki/palm/DBcT/data/DBcT02a.zip>  and a
rough (computer) translation of the readme (from Japanese) is here
<http://www.1src.com/forums/showpost.php?p=809420&postcount=8> .

Some background on my Treo for comparison with whatever you might have:


Sprint 650 running 1.12 firmware
Apps always running: GoodLink, Causerie, mSafe, ProfileCare, Butler,
zLauncher
Free memory (flash): 2.6M (typical)
Free dbCache memory: 1.5M (typical)

The screen shot for how I have dbCacheTool set up is in the attached.

Here are the notes on the dbCacheTool settings - my comments in ( ):

clear type: DB (not entirely sure what the hotsync alternative does)
safe mode: checked ('safe' sounded good)
auto clear: on (to make it automatically run when needed - see free < and
max < settings below)
ask at softreset: not checked (annoying when checked)
clear at softreset: not checked (clearing too early seemed to cause
problems)
free < 3M (see below)
max < 1M (see below)
Apps...: nothing set up (see below)
free <, max <, and Apps...

*       "free <" means - purge the cache when the total amount of free
memory goes below x MB

*       "max <" means - purge the cache when the largest contiguous chunk
(max alloc/ation) of free memory goes below x MB

*       These are "OR" (not "AND") functions, so you can play with the
settings based on your needs. For example, if you have an app which you know
requires 2MB of contiguous memory (maybe some large database app), you would
set "max <" to at least 2MB.


For my Treo, I can't get max alloc/free above 1.5MB anyway, so I set "max <"
to 1MB. I've got "free <" set to 3MB as that seems to allow me to run
anything I need and yet minimize the number of times dbCacheTool runs and I
have to wait for it to finish. Setting this value too high will cause
dbCacheTool to run after just about every app and setting it too low would
result in "out of memory" messages. You'll need to experiment to see which
settings work best for you. You can also set them to 0 to turn the check off
completely but that defeats the purpose of the tool unless you use the
dbCacheToolDA desktop accessory (see below).

The intent of the Apps->AppDetail settings seem to be to override the free <
and max < settings on an app-by-app basis. However, I've never gotten them
to work on the 650 (perhaps they work on the LifeDrive, T2 or E2 devices).
On those screens, you'll see the following options: 

[ ] Event Deq.
[ ] First frm open
[ ] App stop
[ ] Ctrl tap.

free < 
max <

Based on my interpretation of the readme and notes in this 1src forum thread
<http://www.1src.com/forums/showthread.php?t=86635&page=2&pp=15> , these
options control when dbCacheTool will check the amount of available memory
against "free <" and "max <" settings you've chosen:

*       Event Deq - when an event (button press, screen select, etc) is
completed (dequeued)

*       First frm open - after the app starts when it first displays a
screen (form)

*       App stop - when the app finishes and returns control to the launcher

*       Ctrl tap - when a screen button (form control) is complete


Because backup operations touch every file in memory, they can fill up the
cache quickly. To avoid this problem (assuming the Apps->AppDetail settings
work), creating a backup app-specific setting would be useful to ensure the
cache was cleared just before backups are run.

What is the dbCacheToolDA app?

The dbCacheToolDA app is a desktop accessory. You can use it with McPhling
and other apps like it, but I use it with ZLauncher. It allows me to have an
icon for DBCacheTool in the bottom bar, so it only takes one press to get a
small dialog showing amount of free memory and a "Clear" (now) button.
Pressing the Clear button allows you to force a cache clear whenever you
want or need to. If you don't want to use the dbCacheTool Auto Clear
function, this would be a way to clear the cache manually.

Is dbCacheTool a perfect solution?

Unfortunately no, we really need the PalmOS cache manager to be perfected to
avoid all other problems. In my experience, I've seen two types of problems
using dbCacheTool.

1. App-specific crashes
When dbCacheTool runs, it can move databases around in order to make more
cache available. If another app didn't expect that to happen, it may try to
access that data using the original memory location which may no longer
contain the expected data. I've seen this happen with Causerie and GoodLink
when the "Clear at soft reset" option was checked. GoodLink and Causerie
both reference runtime libraries which often get moved by dbCacheTool after
a soft reset. The result is either a system crash or error messages
indicating the app can no longer find certain runtime libraries. The
solution for GoodLink was to turn off the "Clear at soft reset" option and
use Resco Locker to lock Causerie into cache so it's files won't be moved.

2. Lost preferences
Fortunately this is rare, but since the PalmOS API doesn't offer a standard
way to clear the cache, dbCacheTool sometimes acts too aggressive in
clearing the cache which can sometimes cause the Saved Preferences db to get
corrupted. The only solution seems to be to restore the Saved Preferences.db
file from a backup. There are other known causes of the "lost prefs" reset
such as having "Enable Local Network Time" checked on Sprint/Verizon CDMA
phones and rogue Exchange Manager entries. Fix the former by unchecking the
option and the latter by using Butler <http://www.hobbyistsoftware.com/>  to
automatically fix those entries.

What is Resco Locker and why might I need it?

Resco Locker is a free utility which locks apps into dbCache so they can't
be moved by a cache clearing. From http://www.resco.net/palm/locker/ :


Quote:
Resco Locker is a utility that keeps applications locked in memory on NVFS
systems. While Resco Locker can be formally used on non-NVFS systems, it
cannot do anything useful here.

Why to use Resco Locker?

Main reason is the safety. NVFS brought changes to the Palm OS programming
and not all applications reflected them. (Those that were last time updated
prior to NVFS release, could not.) One of the most frequent problems is that
the Palm databases are no longer fixed (in RAM). That's exactly the problem
that is targeted by Resco Locker. For more detailed explanation of the NVFS
specifics see please the discussion on the Resco Backup product page.

As a side effect, applications locked in memory need less time to load,
which in turn may increase the performance of your handheld.    


How do I use Resco Locker?

In general, you should lock any apps that are constantly running in the
background (e.g. TreoGuard, Fonts4OS5, KeyCaps, ringtone/call managers, etc)
if they don't automatically lock themselves into cache (Butler and GoodLink
are two examples which lock themselves). Background apps are those which
automatically respond to some type of event like the time of day, a hotsync
operation, or a particular button or key press. Foreground apps are those
you specifically need to launch yourself.

Another way to determine which apps runs in the background is to use the
free PalmInternals
<http://www.palmgear.com/index.cfm?fuseaction=software.showsoftware&SID=111A
DE9C-7E95-2C3D-775871D188F249C9&PartnerREF=&prodID=46801>  utility to check
the list of apps which register for hede notification. Finally, you may need
to search the forums or contact the developer if you are not sure if an app
should be locked or not. For example, VolumeCare and ProfileCare (from
GoTreo Software <http://www.gotreosoftware.com/> ) are two apps that run in
the background but due to the way they are written, do not need to be
locked.

Is it possible to lock too much with Resco Locker?

Apparently yes. Lock too much cache memory and it won't be available for
anything else so you might not be able to run some of your large apps. The
more memory that's locked, the more often other apps are going to get
swapped out of the cache. So I'd recommend only locking those apps that
really need to stay in the background all the time and then only the ones
where using Resco Locker seems to help. Resco Locker has a 4 MB app lock
limit.

Summary

This is a complicated issue, but hopefully this article will help share what
information the Treo Community has figured out. We can only hope that
PalmOne will continue enhancing PalmOS and improve the stability and
usefulness of our favorite device - the do-everything, know-everything Treo.

 
_____________
 
Leonardo


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/u8TY5A/tzNLAA/yQLSAA/87folB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/treo/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to