how to realize db memory management skem by c lauguage