Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7937591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T22:33:35+00:00 2026-06-03T22:33:35+00:00

I am working with twitter api data and after storing the stream results in

  • 0

I am working with twitter api data and after storing the stream results in text files, I input the data into a parser application. What I have planned for was large data files so I read the content in using delimiter]} to separate the individual posts to avoid the potential for errors? A backup function was to read the data using a buffer and then snip into individual posts.
But the problem is that in some cases for a single post, a memory exception will occur. Now when I look at the individual post it does not seem necessarily large but the text will contain foreign characters or some encoding I guess that causes the memory exception. I have not figured out if is exactly this yet but thought I would get some input or advice from here…

        myreader.TextFieldType = FileIO.FieldType.Delimited
        myreader.SetDelimiters("]}}")
        Dim currentRow As String()

        Try

            While Not myreader.EndOfData
                Try
                    currentRow = myreader.ReadFields()
                    Dim currentField As String

                    For Each currentField In currentRow
                        data = data + currentField
                        counter += 1
                        If counter = 1000 Then
                            Dim pt As New parsingUtilities
                            If Not data = "" Then
                                pt.getNodes(data)
                                counter = 0
                            End If
                        End If
                    Next
                Catch ex As Exception
                    If ex.Message.Contains("MemoryException") Then
                        fileBKup()
                    End If
                End Try

the other time when a memory exception occurs is then I try to split into different posts:

    Dim sampleResults() As String
    Dim stringSplitter() As String = {"}}"}

    ' split the file content based on the closing entry tag
    sampleResults = Nothing
    Try
        sampleResults = post.Split(stringSplitter, StringSplitOptions.RemoveEmptyEntries)

    Catch ex As Exception
        appLogs.constructLog(ex.Message.ToString, True, True)
        moveErrorFiles(form1.infile)
        Exit Sub
    End Try
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T22:33:36+00:00Added an answer on June 3, 2026 at 10:33 pm

    I expect the problem is the strings.

    Strings are immutable, meaning that every time you think you’re changing a string by doing this

    data = data + currentField  
    

    you’re actually creating another new string in memory. So if you do that thousands of times it can cause a problem because they mount up and you get an OutOfMemoryException.

    If you’re building up strings you should use a StringBuilder instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on windows. I have built a twitter application using the twitter
Ive been working with the twitter oauth and api and im having a weird
i am working in application of twitter in flex 3 and action script 3
Does anyone have a working example of OAuth authentication for twitter with Android? I
I'm working with the latest draft of the twitter annotations api. An example bit
I'm working with a project that use Twitter API to get mentions timeline of
I am developing Twitter API to my application. In my app, I want to
I have a website www.iniciativa-iex.com , it's connected with twitter, it get's the data
I am working with twitter's oauth, and ive run into a weird problem. How
I'm working on my own small Twitter application in C#. I've managed to serialize

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.