GPS - outofmemoryexception since WM6

Discussion in 'Questions (Windows Mobile)' started by Agrartec, Oct 11, 2007.

  1. Agrartec

    Agrartec Member Licensed User

    Hello guys,

    I have a problem that I can`t solve since I updated my PPC to WM6.
    If I use a GPS-program then I get the error: "outofmemoryexception" in codeline :
    If serial.InBufferCount>0 Then
    GPS.GPSStream(Serial.InputString)

    I`m already using the serial2.dll (didn`t work at all with the other one).
    Same error occurs when I use the gps-example from erel.
    And I didn`t have this error on WM5.

    Does anyone have an idea what is going on there?

    Cheers

    (I hope this hasn`t been answered somewhere here, if so then sorry, I didn`t find it.)
     
  2. Erel

    Erel Administrator Staff Member Licensed User

  3. Agrartec

    Agrartec Member Licensed User

    Hi Erel,
    no this does not happen immediatly. It can take 5 to 50 seconds after starting the GPS-receiver.
    And this also happens with your "GPS4ppc". :confused:
    But first it disconnected the GPS again after 4 seconds. Reconnecting gave me the same error at line 363.

    What can this be?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Did you try to make a soft reset?
    Other GPS applications work properly (not Basic4ppc apps) on your device?
     
  5. Agrartec

    Agrartec Member Licensed User

    Yes, I made a softreset and tried TomTom Navigator that works fine. But the B4ppc-programs still make the error.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Maybe updating the .Net CF will fix it.
    There were some issues with the serial ports with .Net CF 2.0 / .Net CF 2.0 SP1.
    Please make sure your device is installed with .Net CF 2.0 SP2.
    You can create a new application, add the Hardware library and check Hardware.NetVersion value.
    .Net CF SP2 value is: 2.0.7045
    It can be downloaded here: http://www.microsoft.com/downloads/...2F-07B5-4A8C-8A44-B4E1B196D5C0&displaylang=en
     
  7. Agrartec

    Agrartec Member Licensed User

    If I try to install this update then my device tells me that it already has it in the ROM.
    The strange thing: I send my programm to a friend who owns a Asus P535 with WM6. He does not have this problem, but he doesn`t get a satfix (right after a satfix with another prog).

    I have two HTC P3300 (artemis) and both show the outofmemory-error. I installed another Rom with a lot of free memory to one of my devices, but its the same problem.

    Can someone else who has a device with WM6 try out Erels GPSApp, please. And tell me if it works.
     
  8. Agrartec

    Agrartec Member Licensed User

    I`m still searching for an answer to this problem, so I found out that in the prog GPS4PPC follwing codelines seem to make trouble (however).

    Sub Timer1_Tick
    If serial.InBufferCount>0 Then
    timeout = 0
    GPS.GPSStream(serial.InputString) 'Takes the data received from the GPS to GPSStream.
    Else
    timeout = timeout + 1
    If timeout = 5 Then mnuDisconnect_click
    End If
    End Sub

    In my case the prog always disconnects the GPS after that 5 seconds and sometimes the errormessage from above occurs before.
    So I think that the data doesn`t arrive. :sign0085:
     
  9. agraham

    agraham Expert Licensed User

  10. Agrartec

    Agrartec Member Licensed User

    Thanks for that hint, agraham.

    But in my case I could use the gps of my device under WM5 without any problems with Basic4ppc-progs. And every other gps-prog I found worked so far. Now, since I changed to WM6, I encounter this poroblem. Maybe it has to do with the new serial2.dll.
     
  11. agraham

    agraham Expert Licensed User

    Exactly! - that was my implication. The serial2 library uses System.IO.Ports.SerialPort. This guy has got his code running under WM5 and 2003 on other devices so I suspect that his problem may also be under WM6 on an HTC P3300.
     
  12. Agrartec

    Agrartec Member Licensed User

    I´m not sure, but I think not, because he wrote this message in January, but the update to WM6 for this device came out on 5th of October.

    But maybe you are right that it depends on the code in the dlls. I`m not an expert in these things. I don`t know what changed from serialdevice.dll to serial2.dll.

    It`s just bad luck for me. I need my progs often for work and share them with friends who do the same job and who have the same device (because I told them it would be so useful). Buying a software that can do the work which I need would cost more than 400 Euros.
    I don`t hesitate now, there must be a way to get it running. It would be very helpful if some people with WM6 could try out GPS4PPC, so I know that it is only with my device.
     
  13. agraham

    agraham Expert Licensed User

  14. Erel

    Erel Administrator Staff Member Licensed User

    The Serial2 library is much simpler than the Serial library as it just wraps the SerialPort classes which where introduced with .Net CF 2.0.
    It was tested with WM6.0 devices and it worked correctly.
    Please try to use the Hardware library to check the allocated memory (GCAllocatedMemory).
    The allocated memory should grow to a certain point and then the garbage collector should return it to a small value.
     
  15. Agrartec

    Agrartec Member Licensed User

    You are right Erel. That is happening, but at the point when the garbage collector frees the memory, this error comes up. The values are about 600000 at startup and about 200000 after the first reaction.
    I also checked the .Net version --> it is the latest.
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    There seems to be a compatibility problem with the HTC p3300 and the .Net CF SerialPort class (which is used by Serial2.dll).

    This quote is from: http://www.gpstuner.com/support.htm
    It may have a solution for your problem.
     
  17. Agrartec

    Agrartec Member Licensed User

    I tried that solution at first, but it didn`t help ether.
     
  18. agraham

    agraham Expert Licensed User

    What happens if you force garbage collection with the hardware GCcollect method? It is not normally needed or recommended but I would set a one or two second timer going and call it in that to see if it makes a difference.
     
  19. Agrartec

    Agrartec Member Licensed User

  20. Cableguy

    Cableguy Expert Licensed User

    Have You checkd for any driver updates for your gps device?
    From what I could understand, there are only two possible causes to your problem....
    An hardware issue, being it the firmware of the simple missbehavior of the gps chip, Or an software issue between .net cf and b4ppc (dll wise).

    This put, have you tryed your previous v4 based app again?
    Does it work?
    Have you tryed diferent ports?
    If so then it's problably a software issue.. but not b4ppc side..try looking deeper into the serial class...as for sure is were the problem resides
     
Loading...