SDN have caught the attention of many researches and corporations because of its distinct advantages, but also exposed some problems meanwhile. Limited by today's technology, the size of flow table and the processing capacity of controller may lead to significant packet loss and network delay when matching fails. The matching failure means no corresponding entry in the flow table, which is mainly caused by inappropriate timeout. So we propose a dynamic adaptive approach in this paper for setting a proper timeout based on the actual network traffic, and it is supported by OpenFlow. At every sampling moment, the approach would execute the following steps. Firstly, estimate the remaining resource in the flow table. Then modify the timeout for the new coming flows to change their survival probability. And finally, choose an appropriate sampling period based on the network traffic. The results of experiments certified the effectiveness of the approach.