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

  • Home
  • SEARCH
  • 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 6320899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:03:25+00:00 2026-05-24T16:03:25+00:00

there’s a WinForms-application written in C# using .NET Framework 3.5. This application uses a

  • 0

there’s a WinForms-application written in C# using .NET Framework 3.5. This application uses a C++ Dll which is imported using the following declaration:

[DllImport(DllName)]
public static unsafe extern int LoadDBData(String dsn, String userid, String password);

This method imports data from a given ODBC-DSN using a SQL Server database. The call crashes when there is too much data in database. The provider of this extern dll said this happens because the dll is unable to grab more heap size and my application should provide more heap memory.

How could I solve this problem? As far as I know the only possibility to exclude a component from automatic garbage collection is the unsafe keyword which I already used.
Any idea would be appreciated.

Thanks in advance

Martin

  • 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-05-24T16:03:25+00:00Added an answer on May 24, 2026 at 4:03 pm

    This seems like a problem with the vendor’s library, rather than your code.

    Managed and unmanaged memory should be considered to be completely separate. Managed memory is typically memory allocated on a garbage-collected
    heap, while unmanaged memory is anything else: the ANSI C memory pool
    allocated through malloc(3), custom memory pools, and
    garbage-allocated heaps outside the control of the CLI implementation…

    Note that the above quote is from the Mono documentation, but I believe (if I’m not mistaken) the same is true for .NET in general. If the data is being loaded in the DLL’s internal data structures, then it should allocate its own memory. If you’re providing a buffer which will get filled up with the data, then it will only get filled up with as much data as you’ve allocated for the buffer (and pinned before marshalling). So where is the data being loaded?

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

Sidebar

Related Questions

There is something strange going on. I am using Zend Framework on a subfolder
There seems to have a buzz around the Lightswitch application framework. Reading some posts/forums/articles
There is a StatusProgressBar, which is often accessed from threads. To ensure this, its
There is previous little on the google on this subject other than people asking
There are numerous Agile software development methods. Which ones have you used in practice
There is something I am missing. Say I have the following code: private Bitmap
There is a file as data.html. How to display the contents of this file
There is any syntax to use something like this?: <?php function get_foo() { return
There's a lot of examples for ActionScript over the web using trace() to print
There is a container, for example lets say which has a volume of V.

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.