Neo4j-Gremlin integration

What is the best way to integrate Neo4j with Gremlin? I tried the method described in tinkerpop documentation which connects gremlin server with neo4j in embedded mode. But the queries are sent through gremlin server and this gives ' java.lang.OutOfMemoryError' for larger queries. What is the way to directly talk to Neo4j using Gremlin language?