View Single Post
Copernicus's Avatar
Posts: 1,986 | Thanked: 7,698 times | Joined on Dec 2010 @ Dayton, Ohio
#238
Originally Posted by tecs View Post
I think initializing every keyset as an object (that initializes several more in itself) might be the source of the memory hogging.
Yes, you are absolutely right! That is exactly what is causing the memory issues.

If you place the keysets in separate files and let the app collect the filename list on startup, initializing only one generic keyset object and replacing it's routines and commands each time you choose another one, you are going to get rid of the memory problem and migrate to a config file architecture.
Well, I was hoping to avoid putting so many files into the N900's file system. I thought it would be a pain to manage. But, as you say:

Heck, if you load all the files in the memory as a binary data and initialize only one at a time, you are going to save more memory
That is my current plan. I'm going to take all the keyset data out of the constructors and either (a) create a "factory class" that constructs keysets dynamically as required, or (b) set up a database to read in keyset info as needed. I had looked into sqlite when I started all this, but it seemed like overkill for my needs then; but it might make accessing the keyset data easier for users.

In any case, yes, that should ease the memory problems significantly.

About pairing, I have no idea what that is... It is an old CRT TV that I doubt is smarter than - receive IR commands, execute them...
Ah, I wouldn't put anything past Sony. They can create some amazing products. But yeah, I just looked up the RM-887 in Google, and it doesn't appear to support pairing... I'm not sure what is going wrong.