Scanner Uses Memory

  • Thread starter Thread starter Mystic Mong
  • Start date Start date
M

Mystic Mong

Hi there,

I am relatively new to developing apps on handheld devices using the Compact
Framework and have discovered a rather annoying problem. I hope someone can
help:

I have developed an app using VS 2003 (VB.NET) utilising the Barcode Scanner
on a Symbol PDT8846 (and 8146). After each scan, the available memory goes
down by a differing number of bytes until, after about 200 scans, it runs
out of memory completely. The memory is not released until I close the app.
I have tried every way I know to dispose of the scanner and re-enable it
after each scan. Some ways use more memory than others but the result is the
same, the available memory goes down.

I have listed some of the code below for reference, but has anyone
experienced this problem or is it simply a matter of my development
in-experience.

Any help or tips would be hugely appreciated.

Cheers

Aly


Imports Symbol.Barcode



'Scanner
Dim MyReader As New Reader
Dim MyReaderData As New ReaderData(ReaderDataTypes.Text,
ReaderDataLengths.DefaultText)
Dim MyReaderHandler As New System.EventHandler(AddressOf MyReader_Notify)


'On Load Start Scanner
Private Sub frmCollectData_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

AddHandler MyReader.ReadNotify, MyReaderHandler
MyReader.Actions.Enable()
MyReader.Actions.Read(MyReaderData)

End Sub


'On scan - pass TheReaderData.Text to StockCount Procedure, then start new
read
Private Sub MyReader_Notify(ByVal o As Object, ByVal e As EventArgs)


Dim TheReaderData As ReaderData = MyReader.GetNextReaderData
lblBarcode.Text = TheReaderData.Text
StockCount(TheReaderData.Text)

MyReader.Actions.Flush()
MyReader.Actions.Read(MyReaderData)

End Sub
 
Have you reported this to Symbol? I don't use any Symbol devices from
managed code, but I'd also look for some call in their API to release memory
taken by scan data after it is returned to you.

Paul T.
 
I am using Symbol PPT 2800 for Scanning Barcodes in my Application.I
am terminating the reader while closing the application as shown
below.I am also new to .Net ..recently moved from eVB to .Net.Good
luck

Protected Overloads Overrides Sub OnClosing(ByVal e As
System.ComponentModel.CancelEventArgs)

'Terminate reader
Me.TermReader()

MyBase.OnClosing(e)

End Sub

'Stop reading and disable/close reader

Private Sub TermReader()

'If we have a reader
If Not (Me.MyReader Is Nothing) Then

'Disable reader, with wait cursor
Me.MyReader.Actions.Disable()

'free it up
Me.MyReader.Dispose()

' Indicate we no longer have one
Me.MyReader = Nothing

End If

' If we have a reader data
If Not (Me.MyReaderData Is Nothing) Then

'Free it up
Me.MyReaderData.Dispose()

'Indicate we no longer have one
Me.MyReaderData = Nothing

End If

End Sub

Whiz
 
Have you checked this behavior with one of the sample scanning apps Symbol
provides with the SDK?
 
Hi,

I don;t use a symbol scanner, I use a Socket and an Intermec both require
that you call Dispose() when you are done with it, check if you are doing
that, also make sure that you have only one instance live at the same time.

Cheers,
 
Back
Top