Detection of software bugs and its occurrences, repudiation and its root cause is a very difficult process in large multi threaded applications. It is a must for a software developer or software organization to identify bugs in their applications and to remove or overcome them. The application should be protected from malfunctioning. Many of the compilers and Integrated Development Environments are effectively identifying errors and bugs in applications while running or compiling, but they fail in detecting actual cause for the bugs in the running applications. The developer has to reframe or recreate the package with the new one without bugs. It is time consuming and effort is wasted in Software Development Life Cycle. There is a possibility to use graph mining techniques in detecting software bugs. But there are many problems in using graph mining techniques. Managing large graph data, processing nodes with links and processing subgraphs are the problems to be faced in graph mining approach. This paper presents a novel algorithm named BugLoc which is capable of detecting bugs from the multi threaded software application. The BugLoc uses object template to store graph data which reduces graph management complexities. It also uses substring analysis method in detecting frequent subgraphs. The BugLoc then analyses frequent subgraphs to detect exact location of the software bugs. The experimental results show that the algorithm is very efficient, accurate and scalable for large graph dataset.