# Troubleshooting

This topic provides general troubleshooting information - please refer to the [Output Codes](/features/output-codes.md) topic for more specific details.

## Structural issues with the project

Please ensure that you are using Cover Plugin for IntelliJ on a complete project, as the plugin is unable to run successfully if there are flaws in the project structure. Check that:

* All modules in the project are configured correctly.
* The project is compilable.
* The Java SDK version is correct for your project.

***

## Test directories

IntelliJ looks for an existing test source directory. If an existing test source directory cannot be found, it will create one and then notify the user where the tests have been created.

***

## Memory settings

Diffblue Cover Plugin for IntelliJ requires 4GB of memory to run effectively. If you do not have enough memory available, Diffblue Cover will automatically adjust the memory setting. You can undo this change (but please note that your IDE may be unstable without sufficient memory).

If you wish to adjust the available memory manually, please go to **Help** > **Change Memory Settings** in IntelliJ and amend the **Maximum Heap Size** to at least 4096.

This will update the memory allocation in your `.vmoptions` file. Please restart your IDE for these changes to take effect.

***

## Error scenarios - inaccessible methods

If you are receiving spurious warnings about inaccessible methods, close IntelliJ and delete the `.diffblue index` file. A new one is automatically created when Cover Plugin is run again.

***

## Error scenarios - inotify watchers

In Linux, Diffblue Cover uses the inotify(7) filesystem API to watch for changes to your class files. If you are receiving an error message about running out of `inotify watchers`, please follow the advice below to increase the number of watch handles:

1. Add the following line to either the file `/etc/sysctl.conf` or a new `*.conf` file under the `/etc/sysctl.d/` directory: `fs.inotify.max_user_watches = 524288`
2. Then run this command to apply the change: `sudo sysctl -p --system`
3. Finally, restart your IDE. You should now have enough watch handles for IntelliJ to successfully create your tests.

***

## Resolving Formatting Conflicts between IntelliJ and Spotless

**Issue**:

Users may encounter formatting discrepancies when using Cover Plugin alongside other tools like Spotless. This can lead to unexpected changes in code formatting which may disrupt the development workflow.

**Cause**:

This issue typically arises when the formatting configurations in IntelliJ are not aligned with those specified by Spotless.

**Solution**:

To ensure consistent formatting and avoid any unexpected changes, we recommend that you align the formatting settings in IntelliJ with those of Spotless.

***

#### E166 - Ensure VM is correctly set up

If not already using google-java-format please check and upgrade your VM options in IntelliJ following the guidance here. [Ensure formatter compatibility](/features/cover-plugin/cover-plugin-admin/ensure-formatter-compatibility.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cover-docs-preview.diffblue.com/features/cover-plugin/cover-plugin-admin/troubleshooting.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
