memory problem

Issue #20 new
JS created an issue

Hello.

Thank you for your code and tutorial.

I did following tutorial. but when I typing "/analyze" in the game, the memory error occurred.

Could you tell me how can I solve this problem?

I downloaded BWTAlib_2.2 version, and I worked in "Window7 32bit", "Visual Studio 2013" and "BWAPI_412".

My computer memory is 4GB. Is this code need more memory?

Comments (7)

  1. Alberto Uriarte repo owner

    The problem you are having is not about your computer memory. It's because is trying to access to an invalid point in the memory. Probably a thread problem (BWTA2.2 is not thread safe). Try to execute BWTA without using threads, i.e. comment this line:

    CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)AnalyzeThread, NULL, 0, NULL);
    

    and right after, add this line:

    BWTA::analyze();
    

    This will make StarCraft to "freeze" the first time you are analyzing a map.

  2. JS reporter

    Thank you for your answer.

    Although I changed my program as your advice, however same problem occurred...

  3. Alberto Uriarte repo owner

    I need more information to help you.

    • Does it happen in all the maps you try or only in a specific one?
    • Can you try to use the debug version of BWTA to see the in the Call Stack where exactly the problem occurs?
    • Can you share your project (Visual Studio project settings and C++ files)?
  4. JS reporter
    1. It happens in all maps.
    2. Sorry. I can't do it well... problem occur in BWTA::analyze() function. * I knew that I can use BWTA::analyze() in the ExampleAIModule::onstart() (Issue#8. Bart van Dooren.) * However if the BWTA::analyze() (without CreateThread) is called in onSendText(), memory error occurred .

    3. I use "ExampleAIModule.cpp" of BWAPI 4.1.2.

    Thank you for your answer!

  5. Log in to comment