Online social networks (OSNs) have become more and more popular and have attracted a great many users. Friend recommendation, which is one of the important services in OSN, can help users discover their interested friends and alleviate the problem of information overload. However, most of existing recommendation methods only consider either user link or content information and hence are not effective enough to provide high quality recommendations. In this paper, we propose a topic community-based method via Nonnegative Matrix Factorization (NMF). This method first applies joint NMF model to mine topic communities existing in OSN by combing link and content information. Then it computes user pairwise similarities and makes friends recommendation based on topic communities. Furthermore, this method can be implemented using the MapReduce distributed computing framework. Extensive experiments show that our proposed method not only has better recommendation performance than state-of-the-art methods but also has good scalability to deal with the problem of friend recommendation in large-sale OSNs. Moreover, the application case demonstrates that it can significantly improve friend recommendation service in the real world OSN. Copyright (C) 2016 John Wiley & Sons, Ltd.