Re: [sqlite] Out of memory? How could that be on a 32G iPhone?

2011-05-06 Thread Rolf Marsh
Thank you for the clarification... I appreciate it...

Regards,
Rolf

On 5/6/11 6:23 AM, Jean-Denis Muys wrote:
> On 6 mai 2011, at 15:09, Rolf Marsh wrote:
>
> I figured this out... it was a "pilot-error" on my part...but I do have
> an additional question (see below).
>
> On 5/5/11 9:45 AM, Jean-Denis Muys wrote:
> On 4 mai 2011, at 23:22, Rolf Marsh wrote:
>
>
>
>
> a 32GB iPhone doesn't have 32GB of RAM. It has 32GB of storage space. That's 
> vastly different.
>
> Storage space as in SQLite d/b?
>
> Storage space as in space available on your hard disk.
>
> If you run your app in the simulator, the available storage is literally the 
> available disk space on the OS X volume where your user account is stored. 
> You can find your application somewhere at ~/Library/Application 
> Support/iPhone Simulator/4.3.2/Applications. And your sqlite file is probably 
> in the Documents subdirectory there. You can examine it from the terminal, 
> look up its size, whatever.
>
> When you run your app on the device, the available storage is basically what 
> iTunes tells you is available in the nice bar graph at the bottom of the 
> summary screen.
> Also the *total* storage space is displayed by Xcode's Organizer window under 
> the "Capacity" designation.
>
> JD
>
>
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Out of memory? How could that be on a 32G iPhone?

2011-05-06 Thread Jean-Denis Muys

On 6 mai 2011, at 15:09, Rolf Marsh wrote:

I figured this out... it was a "pilot-error" on my part...but I do have
an additional question (see below).

On 5/5/11 9:45 AM, Jean-Denis Muys wrote:
On 4 mai 2011, at 23:22, Rolf Marsh wrote:




a 32GB iPhone doesn't have 32GB of RAM. It has 32GB of storage space. That's 
vastly different.

Storage space as in SQLite d/b?

Storage space as in space available on your hard disk.

If you run your app in the simulator, the available storage is literally the 
available disk space on the OS X volume where your user account is stored. You 
can find your application somewhere at ~/Library/Application Support/iPhone 
Simulator/4.3.2/Applications. And your sqlite file is probably in the Documents 
subdirectory there. You can examine it from the terminal, look up its size, 
whatever.

When you run your app on the device, the available storage is basically what 
iTunes tells you is available in the nice bar graph at the bottom of the 
summary screen.
Also the *total* storage space is displayed by Xcode's Organizer window under 
the "Capacity" designation.

JD



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Out of memory? How could that be on a 32G iPhone?

2011-05-06 Thread Rolf Marsh
I figured this out... it was a "pilot-error" on my part...but I do have 
an additional question (see below).

On 5/5/11 9:45 AM, Jean-Denis Muys wrote:
> On 4 mai 2011, at 23:22, Rolf Marsh wrote:
>
>
>
> Prior to getting this error, I opened the d/b and inserted one (1) very
> small record...
> Where do I start looking?  I am using FMDB, ZBarSDK (used to read
> barcodes), but I can't imagine that's using all of my memory... and I
> have the d/b set to be a singleton, as indicated by the NSLog entries...
>
> How do I tell how much active memory I'm using?  Where do I start
> looking (I'm a newbie, as you can probably tell by now) :-P
>
>
> a 32GB iPhone doesn't have 32GB of RAM. It has 32GB of storage space. That's 
> vastly different.  Storage space as in SQLite d/b?
>
> How much RAM an iOS device has is not published by Apple. Of course, as a 
> developer, it's easy to find out. And the answer is:
>
> iPhone: 128 MB
> iPhone 3G:  can't remember
> iPhone 3GS: can't remember (and too lazy to lmgtfy.com  
> that).
> iPhone 4: 256 MB
>
> iPad: 256 MB
> iPad 2: 512 MB
>
> Regarding how much free RAM you still have at any one time, the function 
> commonly suggested looks like:
>
>
>
> natural_t  freeMemory(void) {
>  mach_port_t   host_port = mach_host_self();
>  mach_msg_type_number_t   host_size = sizeof(vm_statistics_data_t) / 
> sizeof(integer_t);
>  vm_size_t   pagesize;
>  vm_statistics_data_t vm_stat;
>
>  host_page_size(host_port,&pagesize);
>
>  if (host_statistics(host_port, HOST_VM_INFO, 
> (host_info_t)&vm_stat,&host_size) != KERN_SUCCESS) NSLog(@"Failed to fetch vm 
> statistics");
>
>  natural_t   mem_used = (vm_stat.active_count + vm_stat.inactive_count + 
> vm_stat.wire_count) * pagesize;
>  natural_t   mem_free = vm_stat.free_count * pagesize;
>  natural_t   mem_total = mem_used + mem_free;
>
>  return mem_free;
> }
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Out of memory? How could that be on a 32G iPhone?

2011-05-06 Thread Jean-Denis Muys

On 4 mai 2011, at 23:22, Rolf Marsh wrote:



Prior to getting this error, I opened the d/b and inserted one (1) very
small record...
Where do I start looking?  I am using FMDB, ZBarSDK (used to read
barcodes), but I can't imagine that's using all of my memory... and I
have the d/b set to be a singleton, as indicated by the NSLog entries...

How do I tell how much active memory I'm using?  Where do I start
looking (I'm a newbie, as you can probably tell by now) :-P


a 32GB iPhone doesn't have 32GB of RAM. It has 32GB of storage space. That's 
vastly different.

How much RAM an iOS device has is not published by Apple. Of course, as a 
developer, it's easy to find out. And the answer is:

iPhone: 128 MB
iPhone 3G:  can't remember
iPhone 3GS: can't remember (and too lazy to lmgtfy.com that).
iPhone 4: 256 MB

iPad: 256 MB
iPad 2: 512 MB

Regarding how much free RAM you still have at any one time, the function 
commonly suggested looks like:



natural_t  freeMemory(void) {
mach_port_t   host_port = mach_host_self();
mach_msg_type_number_t   host_size = sizeof(vm_statistics_data_t) / 
sizeof(integer_t);
vm_size_t   pagesize;
vm_statistics_data_t vm_stat;

host_page_size(host_port, &pagesize);

if (host_statistics(host_port, HOST_VM_INFO, (host_info_t)&vm_stat, 
&host_size) != KERN_SUCCESS) NSLog(@"Failed to fetch vm statistics");

natural_t   mem_used = (vm_stat.active_count + vm_stat.inactive_count + 
vm_stat.wire_count) * pagesize;
natural_t   mem_free = vm_stat.free_count * pagesize;
natural_t   mem_total = mem_used + mem_free;

return mem_free;
}

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Out of memory? How could that be on a 32G iPhone?

2011-05-04 Thread Rolf Marsh
Hi Hartwig... I'm looking at the FMDB code, and I don't see any "open" 
for the d/b.  Does FMDB do this for me and I'm just missing it?  Also 
looked at Gus Mueller's blog of examples, and I don't see it there 
either

Regards,
Rolf

On 5/4/11 2:38 PM, skywind mailing lists wrote:
> Hi Rolf,
>
> I am using FMDB and SQLite for more than 2 years now and have not experienced 
> any problems so far. Therefore, I expect that the bug is somewhere else but 
> not inside SQLite (3.7.2) nor FMDB (2009-10-18).
>
> Greetings,
> Hartwig
>
> Am 04.05.2011 um 23:22 schrieb Rolf Marsh:
>
>>
>> Prior to getting this error, I opened the d/b and inserted one (1) very
>> small record...
>> Where do I start looking?  I am using FMDB, ZBarSDK (used to read
>> barcodes), but I can't imagine that's using all of my memory... and I
>> have the d/b set to be a singleton, as indicated by the NSLog entries...
>>
>> How do I tell how much active memory I'm using?  Where do I start
>> looking (I'm a newbie, as you can probably tell by now) :-P
>>
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Out of memory? How could that be on a 32G iPhone?

2011-05-04 Thread skywind mailing lists
Hi Rolf,

I am using FMDB and SQLite for more than 2 years now and have not experienced 
any problems so far. Therefore, I expect that the bug is somewhere else but not 
inside SQLite (3.7.2) nor FMDB (2009-10-18).

Greetings,
Hartwig

Am 04.05.2011 um 23:22 schrieb Rolf Marsh:

> 
> 
> Prior to getting this error, I opened the d/b and inserted one (1) very 
> small record...
> Where do I start looking?  I am using FMDB, ZBarSDK (used to read 
> barcodes), but I can't imagine that's using all of my memory... and I 
> have the d/b set to be a singleton, as indicated by the NSLog entries...
> 
> How do I tell how much active memory I'm using?  Where do I start 
> looking (I'm a newbie, as you can probably tell by now) :-P
> 
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users