Force unloading a DLL in RAM

Login to reply to this topic.
Wed, 2007-07-04 13:53
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 2006

Hello,

I think I have a problem when upgrading a DLL to a newer version. My application sometimes crash after an update with the following scenario:
- the application is active and running (made of a couple of EXE that both use an engine found in a separate DLL).
- I install a newer version (some functions may have been added in the DLL, but its interface is frozen)
- the installer starts my application again (as required by the PKG file).
- and at that point my application (sometimes) crashes.

After a phone rebbot, everything works well. I cannot find the information again, but I remember having read somewhere that DLL were kept in RAM 15 or 20 seconds after nobody uses them and that could cause a problem in case of upgrade. Which is typically my case.

However, I do not have a solution for this. How can I force Symbian OS to discard the RAM copy of my DLL ?

Thanks for any help.


Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant


Wed, 2007-07-04 14:39
Joined: 2003-05-27
Forum posts: 363
Re: Force unloading a DLL in RAM

Hello Eric,

I have never seen this problem. I have had to use a "killer" process that is run automatically on uninstallation by the uninstaller, but that was to force release of fonts, recognizers etc.

Even if the kernel did "lazy" unloading of DLLs, I have a hard time believing it would actually result in this kind of problem.

Were you able to verify that the installer installs the newer version? If that is the case, there is no way that the in-RAM loaded code would be mismatched with the on-disk version.

If you need a quick fix and you know that adding a delay would solve the problem, then perhaps you could have the PKG contain a "starter" EXE with a delay to start the actual app .

Cheers,
Pawel

Wed, 2007-07-04 14:50
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 2006
Re: Force unloading a DLL in RAM

Hello Pawel,

Good to hear from you again!

Were you able to verify that the installer installs the newer version? If that is the case, there is no way that the in-RAM loaded code would be mismatched with the on-disk version.

Yes it does. Actually my DLL also acts as a repository for some bitmaps and skinned component shared by the others EXEs... and the new icons only appears after a phone reboot. New features are also available after the installation & reboot.

If you need a quick fix and you know that adding a delay would solve the problem, then perhaps you could have the PKG contain a "starter" EXE with a delay to start the actual app .

Yep. But that would be a last solution to implement. The user experience would be too strange as the application appear on screen right after installation and that is a requirement from my customer.

Cheers,


Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Wed, 2007-07-04 14:53
Joined: 2003-05-27
Forum posts: 363
Re: Force unloading a DLL in RAM

Ok,

Let's separate icons and code from each other Smiling. There is a known problem with SVG and bitmap caching that will result in "old" icons showing even if you explicitly load new ones. I have a solution to that somewhere..

But can you verify that you indeed have "new" code on disk and "old" code in memory?

Thu, 2007-07-05 15:17
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 2006
Re: Force unloading a DLL in RAM

Let's separate icons and code from each other Smiling. There is a known problem with SVG and bitmap caching that will result in "old" icons showing even if you explicitly load new ones. I have a solution to that somewhere..

If you find the solution back.... I am interested!

But can you verify that you indeed have "new" code on disk and "old" code in memory?

So far, everything looks fine... but this only happen sometimes. So it is quite difficult to reproduce but only happen just after an update of the app.


Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Thu, 2007-07-05 18:52
Joined: 2003-05-27
Forum posts: 363
Re: Force unloading a DLL in RAM

Ok,

I found the thread where I discussed this before. It is good to know this when dealing with SVG bitmaps on S60. Deleting the bitmap object will NOT purge the SVG data from FBS cache on its own, you must use DestroyIconData method for this!

http://discussion.forum.nokia.com/forum/archive/index.php/t-93498.html

Cheers,
Pawel

Fri, 2007-07-06 09:15
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 2006
Re: Force unloading a DLL in RAM

Cool... Thanks a lot Smiling


Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Fri, 2007-07-20 16:32
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 2006
Re: Force unloading a DLL in RAM

I am 99% sure that running exe / dlls are not correctly upgraded by the installer (tested on N70 / S60 2nd edition device).
Looks ok on 3rd Edition devices however.


Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

  • Login to reply to this topic.