aliencreeper
Programmer
Greetings!
I made gomoku (noughts - and crosses) program using minimax and alpha-beta pruning to seek best moves. The play board is defined as 2D array [1..15, 1..15] of shortint.
I made lot of auxiliary functions that manage this board, find rows, wins, marks and so on. During computer's move, they are used around 800 000 times. One of their parameter is this play board. I decided not to use new board variable but pointer to this board as a parameter to save memory. It is absolutely functional however memory usage is rapidly raising during recursive search for moves. (after 5 moves, there is around 70 MB of RAM used only by my program!) ... please help me to solve this problem, I'll be very grateful.
P.S.: After search, memory usage won't drain.
I made gomoku (noughts - and crosses) program using minimax and alpha-beta pruning to seek best moves. The play board is defined as 2D array [1..15, 1..15] of shortint.
I made lot of auxiliary functions that manage this board, find rows, wins, marks and so on. During computer's move, they are used around 800 000 times. One of their parameter is this play board. I decided not to use new board variable but pointer to this board as a parameter to save memory. It is absolutely functional however memory usage is rapidly raising during recursive search for moves. (after 5 moves, there is around 70 MB of RAM used only by my program!) ... please help me to solve this problem, I'll be very grateful.
P.S.: After search, memory usage won't drain.