Out of memory exception

JB7TS

Member
Licensed User
Hello,

I'm working on a simple software that use GPS to get my position and send the data to a web page that store it in a db.

I get the code for GPS from this forum using Serial2.dll

The program worked, but now i'm trying to add more functions.

I add the flitedevice.dll for text to speech and i load an image from the web using dzHTMLViewLib.dll

The problem now is that i get an out of memory exception on Sub Timer1_Tick (GPS timer).

This line raise the error:
GPS1.GPSStream(Serial1.InputString)

Before adding more functions the software was fine. It isn't a problem with the GPS but this line raise the error. I check how much memory the application take and it is 700 kb.

i'm using to much memory?

Someone can help me?

Thanks a lot to everyone.


Lorenzo
 

JB7TS

Member
Licensed User
It's a Omnia i900.


I'll give a try to GPSDriver, but the strange thing is that with GPS/Serial2 the application work ok but if i add some more functions the out of memory exception raise.

Is GPSDriver better that GPS/Serial2 ?

It's supported by more device?


Thank you.
 

agraham

Expert
Licensed User
Longtime User
Is GPSDriver better that GPS/Serial2 ?
I think so but then I'm biased as I originally wrote it :).

Actually it was needed because some devices, like a lot of HTCs, seem to have an incompatibility with the .NET Serial Port class which Serial2 uses, see http://www.b4x.com/forum/questions-help-needed/972-gps-outofmemoryexception-since-wm6.html. GPSDriver uses the Windows Intermediate Driver included with WM5.0 and later devices. WID allows several applications to use the GPS at the same time by and it avoids having to use a serial port in Basic4ppc to access the GPS.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Is GPSDriver better that GPS/Serial2 ?
While the fact that agraham originally wrote it IS enough to make it better, there is another reason. On newer devices (since WM5) Microsoft Intermediate GPS Driver controls the GPS and this driver emulates the serial port for backwards compatibility.
Some devices do not handle it correctly and all kinds of issues rise from it.
So calling the GPS driver directly is safer (and simpler).
 
Top